Fix bug: cannot upload single file

This commit is contained in:
2022-08-03 12:13:48 -04:00
parent 23e27d2f28
commit 1d2e36c6f8
@@ -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;
}