From 1d2e36c6f81af6d3594372394b1805c00f8166f2 Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Wed, 3 Aug 2022 12:13:48 -0400 Subject: [PATCH] Fix bug: cannot upload single file --- www/application/views/jobs/uploads/upload_files.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/www/application/views/jobs/uploads/upload_files.php b/www/application/views/jobs/uploads/upload_files.php index c2519cd1..a6c786fa 100644 --- a/www/application/views/jobs/uploads/upload_files.php +++ b/www/application/views/jobs/uploads/upload_files.php @@ -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; }