diff --git a/lib/form/filepicker.php b/lib/form/filepicker.php index 1c590486fab..5dc2b3159a0 100644 --- a/lib/form/filepicker.php +++ b/lib/form/filepicker.php @@ -75,6 +75,7 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input { $args->accepted_types = $this->_options['accepted_types']?$this->_options['accepted_types']:'*'; $args->return_types = FILE_INTERNAL; $args->itemid = $draftitemid; + $args->maxbytes = $this->_options['maxbytes']; $args->context = $PAGE->context; $html = $this->_getTabs(); diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 0e5687b16e0..3a3d7e4dcfa 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1914,7 +1914,12 @@ class core_renderer extends renderer_base { if (empty($currentfile)) { $currentfile = get_string('nofilesattached', 'repository'); } - $maxsize = get_string('maxfilesize', 'moodle', display_size(get_max_upload_file_size())); + if ($options->maxbytes) { + $size = $options->maxbytes; + } else { + $size = get_max_upload_file_size(); + } + $maxsize = get_string('maxfilesize', 'moodle', display_size($size)); $html = << $icon_progress