I'm integrating dropzone.js into my form, but I have an issue regarding my file uploads. I have my dropzone set up, and file uploads are in the $_FILES array. I want to call file_save_upload to handle the file management, but per the code:
// Make sure there's an upload to process.
if (empty($_FILES['files']['name'][$form_field_name])) {
return NULL;
}
it looks for the files under $_FILES['files']['name']. The dropzone.js uploads my files to $_FILES['file']['file'].
I haven't seen an easy way to specify an input element for dropzone.js to upload to. On the Form API side, I could just mimic the functionality of file_save_upload(), but all the code already exists and it does a lot, and I'd hate to duplicate it.
Maybe I can copy the $_FILES['file']['file'] array over to $_FILES['files'], then call file_save_upload()? I'm trying to make sure there is a better way to do it before I start hacking.