
$(document).bind('drop.filedrop', docDrop).bind('dragenter.filedrop', docEnter).bind('dragover.filedrop', docOver).bind('dragleave. The script.js file that does the ajax and needs the YEAR variable $(function(), default_opts, options) Įlement.bind('drop.filedrop', drop).bind('dragenter.filedrop', dragEnter).bind('dragover.filedrop', dragOver).bind('dragleave.filedrop', dragLeave) The process.php file which performs the upload $str)) Ĭase 'application/':Ĭase 'application/':Ĭase 'application/': If you need to upload a larger file, please contact the Webmaster.' Valid media types are:įlv (recommended), fla, rma, wmv (NOT recommended), mp4, aviĪlso, a file cannot exceed 20 megabytes in size. Forbidden media types will be rejected before submission. Note: Only certain types of media is allowed. The conference.php file (the portion that has the drag n drop) fetch_all_array("SELECT conf_year FROM tbl_conferences WHERE id = '$_POST'") Based on a database query on the "conferences.php" page which creates a variable for the year of the conference, I need to send that variable into the javascript so that it knows to save files in THAT year. For example, suppose there's a folder called '2011' with the audio, video, docs, and images sub folders (this folder and the subfolders were created in a previous step along with a database entry for this particular conference). The problem I'm having is telling the javascript what year to save the files to. I also have additional folders in the conference year folder for the various types of media (I use mimetype and a switch to figure that out). The company does yearly conferences, and I have a file path 'file/path/to/conferencefiles' where I save media (docs, images, vids, etc) based on the YEAR of the conference. Currently I have it working about 2/3s the way I want it to. If an email message includes an attachment, the MIME type would be set to the appropriate file type (for example, 'application/pdf. $.I am using to create a HTML5 drop box for users. When users send email requests with Azure Communication Services Email, they can specify the MIME type of the email content, which allows the recipients email client to properly display and interpret the message. set a handler to upload the files when the submit button is clicked
#Filedrop send mime type code#
you should possibly put code in here to clean up afterwards

runs after all files have been uploaded or otherwise dealt with this pushes the done() callback into the global mentioned earlier it also fills in the filename so that it's obvious which meta boxes this is just to clone meta boxes for the user to fill in for each file this is the important custom function you need to supply

other important parameters related to upload, read the documentation for details Url: 'upload.php', // upload handler, handles each file separately, can also be a function taking the file and returning a url If you want meta boxes to appear for each file, then you need to append the appropriate html on a per file basis to allow the user to fill them in.Ī summary of the code I would suggest is below: var uploads_to_call = // the global to store all the file upload callbacksįallback_id: 'upload_button', // an identifier of a standard file input element, becomes the target of "click" events on the dropzone You also need to store references to the done() functions that are provided to your custom function for each file, so that you can call them later, causing the files to be uploaded. To use the jquery extension you've chosen, you need to take advantage of the beforeSend option, and supply your own function.
#Filedrop send mime type download#
You should also download and use a later version of jquery than the one bundled with that sample code.

You need to download and use the latest version from its project home for this to work.
#Filedrop send mime type full#
The sample code you have linked to appears to be using, which is written by Weixi Yen. To support an additional media type, simply set the data in the QMimeData object with the setData() function, supplying the full MIME type and a QByteArray.
