我有 DropZone 上传文件。
我已将 parallelUploads 设置为 10。我正在删除 125 个文件,我只收到一个对服务器的请求,一个请求中有 20 个文件。我还将 parallelUploads 设置为 9999,但我在服务器上再次收到 20 个文件。
这是代码:
Dropzone.autoDiscover = false;
//maxFilesize: 20 is 20 MB
var myDropzone = new Dropzone("#myDropzoneForm", {
addRemoveLinks: true,
method: 'post',
uploadMultiple: true,
parallelUploads: 10, // Also set to 9999 but not working
maxFileSize: 4,
autoProcessQueue: false
});
myDropzone.on('addedfiles', function () {
setTimeout(function () {
sendFiles();
}, 1);
});
myDropzone.on('addedfile', function (file) {
var iFilesLength = myDropzone.files.length;
if (iFilesLength > 0) {
var bFileFound = false;
for (var iiFileLength = iFilesLength - 1; iiFileLength >= 0; iiFileLength--) {
if (file.name == myDropzone.files[iiFileLength].name) {
if (bFileFound)
myDropzone.removeFile(myDropzone.files[iiFileLength]);
else bFileFound = true;
}
}
}
});
function sendFiles() {
if (myDropzone.files.length > 0) {
myDropzone.processFiles(myDropzone.files);
}
}
myDropzone.on('successmultiple', function (file, responseText) {
$("#myResponse").html(responseText);
});