From 64bf0fa47fe4c623672cf86e831f66974e7f650c Mon Sep 17 00:00:00 2001 From: Pellaeon Lin Date: Sun, 8 Dec 2013 23:17:35 +0800 Subject: Display different messages for uploadLimit and freeSpace --- apps/files/js/file-upload.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'apps/files/js') diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 979bb74b13f..7bd0eb81f57 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -233,11 +233,17 @@ $(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', 'File size exceeds upload limit'); } + + // check free space + if (selection.totalBytes > $('#free_space').val()) { + data.textStatus = 'notenoughspace'; + data.errorThrown = t('files', 'Not enough free space'); + } // end upload for whole selection on error if (data.errorThrown) { -- cgit v1.2.3