我正在使用cycero出色的additions到Sebastian Tschan的jQuery File上传中来同时提交文件名。
// 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};
});
不幸的是,当我执行多文件上传时,它为所有文件发布了相同的文件名,而不是每个文件名。
如何为每个文件创建文件名字段/参数?
https://dev.over60travel.com/sandbox/jQuery-File-Upload/index.html