Fix bug: cannot upload single file
This commit is contained in:
@@ -136,13 +136,16 @@ function fileToUploadChanged(e) {
|
||||
|
||||
function fileToUploadRun() {
|
||||
var fileList = $('#fileToUpload').prop("files");
|
||||
var i, n = 0;
|
||||
var i, n = -1;
|
||||
console.log('length='+fileList.length);
|
||||
for ( i = 0; i < fileList.length; i++) {
|
||||
if (fileList[i].size <= sizeLimit) {
|
||||
n = i;
|
||||
} else {
|
||||
console.log('file "'+fileList[i].name+'" exceeds size limit '+fileList[i].size+' > '+sizeLimit);
|
||||
}
|
||||
}
|
||||
if (n < 1) {
|
||||
if (n < 0) {
|
||||
alert('No files for upload!');
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user