Restricting maximum file size in filemanager

Restricting maximum file size in filemanager

by Michael Aherne -
Number of replies: 1
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I'm trying to create a form which uses a filemanager component (Moodle 2.8), and want to prevent users from choosing more than 10Mb of files in total, but am getting quite confused. In the documentation (https://docs.moodle.org/dev/Using_the_File_API_in_Moodle_forms#filemanager), it says:

maxbytes (Default 0) Restricts the total size of all the files.

However, this option appears to restrict the size of each individual file rather than the total size. There's another option "areamaxbytes" in the filemanager code which does actually restrict the total size of all the files, but this seems to be completely undocumented.

Can anyone help me to make sense of what's going on here? Is the documentation wrong? Or is maxbytes behaving wrongly in the code? Is areamaxbytes a supported feature? Any answers would be much appreciated!

(I'm happy to update the documentation or create a patch for the code, just not sure what's required.)
Average of ratings: -
In reply to Michael Aherne

Re: Restricting maximum file size in filemanager

by Michael Aherne -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I've gone ahead and updated the documentation for this.