I'm using cycero's excellent additions to Sebastian Tschan's jQuery File upload to submit the filename at the same time.
// Storing the file name in the queue
var fileName = "";
// On file add assigning the name of that file to the variable to pass to the web service
$('#fileupload').bind('fileuploadadd', function (e, data) {
$.each(data.files, function (index, file) {
fileName = file.name;
});
});
// On file upload submit - assigning the file name value to the form data
$('#fileupload').bind('fileuploadsubmit', function (e, data) {
data.formData = {"imagefilename" : fileName};
});
Unfortunately when I do a multi-file upload it posts the same filename for all files rather than a filename each.
How do I create a filename field/argument for each file?
https://dev.over60travel.com/sandbox/jQuery-File-Upload/index.html