$string['logfilenotavailable'] = 'Logs not available';
$string['loginasnoenrol'] = 'You cannot use enrol or unenrol when in course "Login as" session';
$string['loginasonecourse'] = 'You cannot enter this course.<br /> You have to terminate the "Login as" session before entering any other course.';
-$string['maxbytes'] = 'This file is bigger than the maximum size';
-$string['maxareabytes'] = 'Not enough available space to store this file';
+$string['maxbytes'] = 'The file is larger than the maximum size allowed.';
+$string['maxareabytes'] = 'The file is larger than the space remaining in this area.';
$string['messagingdisable'] = 'Messaging is disabled on this site';
$string['mimetexisnotexist'] = 'Your system is not configured to run mimeTeX. You need to download the appropriate executable for you PHP_OS platform from <a href="http://moodle.org/download/mimetex/">http://moodle.org/download/mimetex/</a>, or obtain the C source from <a href="http://www.forkosh.com/mimetex.zip"> http://www.forkosh.com/mimetex.zip</a>, compile it and put the executable into your moodle/filter/tex/ directory.';
$string['mimetexnotexecutable'] = 'Custom mimetex is not executable!';
$string['markedthistopic'] = 'This topic is highlighted as the current topic';
$string['markthistopic'] = 'Highlight this topic as the current topic';
$string['matchingsearchandrole'] = 'Matching \'{$a->search}\' and {$a->role}';
-$string['maxsizeandattachments'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}';
-$string['maxsizeandattachmentsandareasize'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}, overall limit: {$a->areasize}';
-$string['maxsizeandareasize'] = 'Maximum size for new files: {$a->size}, overall limit: {$a->areasize}';
+$string['maxareabytesreached'] = 'The file (or the total size of several files) is larger than the space remaining in this area.';
+$string['maxbytesforfile'] = 'The file {$a} is larger than the maximum size allowed.';
+$string['maxfilesize'] = 'Maximum size for new files: {$a}';
$string['maxfilesreached'] = 'You are allowed to attach a maximum of {$a} file(s) to this item';
+$string['maximumchars'] = 'Maximum of {$a} characters';
$string['maximumgrade'] = 'Maximum grade';
$string['maximumgradex'] = 'Maximum grade: {$a}';
-$string['maximumchars'] = 'Maximum of {$a} characters';
$string['maximumshort'] = 'Max';
$string['maximumupload'] = 'Maximum upload size';
$string['maximumupload_help'] = 'This setting determines the largest size of file that can be uploaded to the course, limited by the site-wide setting set by an administrator. Activity modules also include a maximum upload size setting for further restricting the file size.';
$string['maxnumberweeks'] = 'Maximum for number of weeks/topics';
$string['maxnumberweeks_desc'] = 'This controls the maximum options that appears in the "Number of weeks/topics" setting for courses.';
-$string['maxsize'] = 'Max size: {$a}';
-$string['maxfilesize'] = 'Maximum size for new files: {$a}';
$string['maxnumcoursesincombo'] = 'Browse <a href="{$a->link}">{$a->numberofcourses} courses</a>.';
+$string['maxsize'] = 'Max size: {$a}';
+$string['maxsizeandareasize'] = 'Maximum size for new files: {$a->size}, overall limit: {$a->areasize}';
+$string['maxsizeandattachments'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}';
+$string['maxsizeandattachmentsandareasize'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}, overall limit: {$a->areasize}';
$string['memberincourse'] = 'People in the course';
$string['messagebody'] = 'Message body';
$string['messagedselectedusers'] = 'Selected users have been messaged and the recipient list has been reset.';
var i;
for (i=0; i<files.length; i++) {
if (this.options.maxbytes > 0 && files[i].size > this.options.maxbytes) {
- // Check filesize before attempting to upload
- this.print_msg(M.util.get_string('uploadformlimit', 'moodle', files[i].name), 'error');
+ // Check filesize before attempting to upload.
+ this.print_msg(M.util.get_string('maxbytesforfile', 'moodle', files[i].name), 'error');
this.uploadqueue = []; // No uploads if one file is too big.
return;
}
if (sizereached > this.options.areamaxbytes) {
this.uploadqueue = [];
this.renamequeue = [];
- this.print_msg(M.util.get_string('uploadformlimit', 'moodle', file.name), 'error');
+ this.print_msg(M.util.get_string('maxareabytesreached', 'moodle'), 'error');
return false;
}
}
$module = array('name' => 'core_dndupload',
'fullpath' => '/lib/form/dndupload.js',
'requires' => array('node', 'event', 'json', 'core_filepicker'),
- 'strings' => array(array('uploadformlimit', 'moodle'), array('droptoupload', 'moodle'), array('maxfilesreached', 'moodle'), array('dndenabled_inbox', 'moodle'), array('fileexists', 'moodle')));
+ 'strings' => array(array('uploadformlimit', 'moodle'), array('droptoupload', 'moodle'), array('maxfilesreached', 'moodle'),
+ array('dndenabled_inbox', 'moodle'), array('fileexists', 'moodle'), array('maxbytesforfile', 'moodle'),
+ array('maxareabytesreached', 'moodle')
+ ));
break;
}
die(json_encode($err));
}
- // Check if we exceed the max bytes of the area.
- if (file_is_draft_area_limit_reached($itemid, $areamaxbytes, filesize($downloadedfile['path']))) {
- throw new file_exception('maxareabytes');
- }
-
// Check if exceed maxbytes.
if ($maxbytes != -1 && filesize($downloadedfile['path']) > $maxbytes) {
throw new file_exception('maxbytes');
}
+ // Check if we exceed the max bytes of the area.
+ if (file_is_draft_area_limit_reached($itemid, $areamaxbytes, filesize($downloadedfile['path']))) {
+ throw new file_exception('maxareabytes');
+ }
+
$info = repository::move_to_filepool($downloadedfile['path'], $record);
if (empty($info)) {
$info['e'] = get_string('error', 'moodle');
$record->itemid = 0;
}
+ if (($maxbytes!==-1) && (filesize($_FILES[$elname]['tmp_name']) > $maxbytes)) {
+ throw new file_exception('maxbytes');
+ }
+
if (file_is_draft_area_limit_reached($record->itemid, $areamaxbytes, filesize($_FILES[$elname]['tmp_name']))) {
throw new file_exception('maxareabytes');
}
- if (($maxbytes!==-1) && (filesize($_FILES[$elname]['tmp_name']) > $maxbytes)) {
- throw new file_exception('maxbytes');
- }
$record->contextid = $context->id;
$record->userid = $USER->id;