diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-08-14 23:24:18 +0200 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-08-14 23:24:18 +0200 |
commit | f6a6f8541a62d8eac3b27cce9856446c46f11b3a (patch) | |
tree | 6c08b0c6b7fcf7cef6362e17d9b08261cdda429f /apps | |
parent | c1102b1671a711e8c708b8633bb8648c7af28ba8 (diff) | |
parent | eb2669448dedfb811ff3d6091f9ce8b2cf27b2f8 (diff) | |
download | nextcloud-server-f6a6f8541a62d8eac3b27cce9856446c46f11b3a.tar.gz nextcloud-server-f6a6f8541a62d8eac3b27cce9856446c46f11b3a.zip |
Merge pull request #10374 from ogasser/compare_upload_limit_against_biggest_file
Compare upload limit against biggest file
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/file-upload.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 2637d13f9ba..ff999bae4ff 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -233,7 +233,8 @@ OC.Upload = { data.originalFiles.selection = { uploads: [], filesToUpload: data.originalFiles.length, - totalBytes: 0 + totalBytes: 0, + biggestFileBytes: 0 }; } var selection = data.originalFiles.selection; @@ -273,13 +274,15 @@ OC.Upload = { // add size selection.totalBytes += file.size; + // update size of biggest file + selection.biggestFileBytes = Math.max(selection.biggestFileBytes, file.size); - // check PHP upload limit - if (selection.totalBytes > $('#upload_limit').val()) { + // check PHP upload limit against biggest file + if (selection.biggestFileBytes > $('#upload_limit').val()) { data.textStatus = 'sizeexceedlimit'; data.errorThrown = t('files', 'Total file size {size1} exceeds upload limit {size2}', { - 'size1': humanFileSize(selection.totalBytes), + 'size1': humanFileSize(selection.biggestFileBytes), 'size2': humanFileSize($('#upload_limit').val()) }); } |