mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #61241
[Bug 1904946] Re: Filebrowser - Uploading number of files exceed limit give never-ending spinner
It looks like if you add to the upload_validate the following
htdocs/artefact/file/js/filebrowser.js
@@ -112,6 +112,13 @@ var FileBrowser = (function($) {
$('#' + self.id+'_upload_messages').append($('<div>', {'class':'alert alert-danger', 'text':get_string('youmustagreetothecopyrightnotice')}));
return false;
}
+console.log('number of files ' + $('#' + self.id + '_userfile')[0].files.length);
+ if ($('#' + self.id + '_userfile')[0].files.length > 20) {
+ var errmsg = $('<div>', {'class':'alert alert-danger'});
+ errmsg.html(get_string_ajax('fileuploadtoomany', 'error', globalconfig.maxuploadsizepretty));
+ $('#' + self.id+'_upload_messages').append(errmsg);
+ return false;
+ }
it will stop the upload when over 20
so just need to change the '20' to a variable where we get the info from php_ini
and also have a fileuploadtoomany lang string
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1904946
Title:
Filebrowser - Uploading number of files exceed limit give never-ending
spinner
Status in Mahara:
In Progress
Bug description:
In the /etc/php/7.2/apache2/php.ini files it states max_file_uploads =
20
Trying to upload more than max_file_uploads in one request will cause
the wrong error messages to appear.
Reproduce:
1. Create -> Files -> Browse
2. Select 21 files and click 'ok'
Expect:
- Info messages appear for each upload-file saying it's being uploaded
- Once uploaded, the matching info message turns to a temp success message (green) and disappears
- All the selected files have been uploaded and appear in the user's list of files
Actual:
- Info messages appear for each upload-file saying it's being uploaded
- The the 21st file does not get uploaded due to the restriction but the user doesn't know about the restriction
- The info message matching the 1st file in the selected upload-list stays forever spinning.
Notes:
- Even if a message stays spinning forever because there was a file(s) that didn't get uploaded, the text in the message should match the non-uploaded file
- There should be a message informing the user of the max number of files they're allowed to upload at any one time
- The filebrowser could prevent the user from selecting more than the max_file_uploads number
Todo:
- (Maximum upload size: [SPACE AVAILABLE]MB, maximum file uploads: [VALLUE FROM PHP.INI FILE], check what happens when PHP.ini doesn't have a value for max_file_uploads)
- Error message: replace info message with an error message for the same file.
- (nice to have)check upload_validate js function to check if we can alert the user before files are uploaded
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1904946/+subscriptions
References