Using dropzone, or blueimp, it's pretty simple to add fields to the upload handler.
Here's a barebones of one of my dropzone scripts with extra post data
The .bind () function is where the fields are added to the submission
$('#drop_zone_outer_div').fileupload({
// This element will accept file drag/drop uploading
autoUpload: true,
dropZone: $('#drop_div_id'),
limitMultiFileUploads:1,
maxNumberOfFiles: 1,
fileInput: $('#input_field_id'),
url: 'url_to_file',
dataType: 'text',
// This function is called when a file is added to the queue;
// either via the browse button, or via drag/drop:
add: function (e, data) {
var tpl = $('<li class="working"><p></p></li>');
// Append the original file name and file size
tpl.find('p').text("Submitted File: " + data.files[0].name).append(' <i>' + formatFileSize(data.files[0].size) + '</i>');
// Add the HTML to the UL element
data.context = $(ul).html(tpl);
// upload the file on btn click
$('#btnSubmit').click(function(){
var jqXHR = data.submit();})
},
progressall: function (e, data) {
},
done: function(e, data){
}
}).bind('fileuploadsubmit', function (e, data) {
data.formData = {
name: $('#upload_name_input').val(),
comment: $('#comment_id').val(),
other: $('#other_input').val()
};
});
</script>
</code>
</pre>