diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-02-04 08:04:19 -0800 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-02-04 08:04:19 -0800 |
commit | 0609f30d1c4ab01804d0ecf943c0d9146bb41cb7 (patch) | |
tree | 28f39a748ad378c20fbc12e7398d0df932441d31 /apps/files/js/file-upload.js | |
parent | bd6734291cd56b4d3d494a6e4138435ecb49171e (diff) | |
parent | 099b71c712c38de7dac7e386252da02bb0cadf12 (diff) | |
download | nextcloud-server-0609f30d1c4ab01804d0ecf943c0d9146bb41cb7.tar.gz nextcloud-server-0609f30d1c4ab01804d0ecf943c0d9146bb41cb7.zip |
Merge pull request #6235 from NCTU-NBA/pr-exceed_upload_limit_msg
Change misleading message when file size exceeds upload limit
Diffstat (limited to 'apps/files/js/file-upload.js')
-rw-r--r-- | apps/files/js/file-upload.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 486273a910c..149e4a9666b 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -241,10 +241,22 @@ $(document).ready(function() { // add size selection.totalBytes += file.size; - //check max upload size - if (selection.totalBytes > $('#max_upload').val()) { + // check PHP upload limit + if (selection.totalBytes > $('#upload_limit').val()) { + data.textStatus = 'sizeexceedlimit'; + data.errorThrown = t('files', 'Total file size {size1} exceeds upload limit {size2}', { + 'size1': humanFileSize(selection.totalBytes), + 'size2': humanFileSize($('#upload_limit').val()) + }); + } + + // check free space + if (selection.totalBytes > $('#free_space').val()) { data.textStatus = 'notenoughspace'; - data.errorThrown = t('files', 'Not enough space available'); + data.errorThrown = t('files', 'Not enough free space, you are uploading {size1} but only {size2} is left', { + 'size1': humanFileSize(selection.totalBytes), + 'size2': humanFileSize($('#free_space').val()) + }); } // end upload for whole selection on error |