Maximum file upload size

Maximum file upload size

by sara HHH -
Number of replies: 6

Hi all;

Please forgive me if this is covered somewhere that I have not found.  If so, a link or a search term to find it would be truly appreciated.

in Site administration/Security/Site policies which there is Maximum uploaded file size (Drop Down menu). i have changed in php.ini to 10G (upload_max_filesize=10G).
Currently there can be only values up to 100 MB or 10 GB Setting the maximum file size. In between, there are no choices.
It would be ideal if i could set here 500 MB (between these two numbers)and 10 GB option still available for selection if it again a large backup needs to be imported .

many thanks

S.K

(Edited by Howard Miller to make subject sensible - original submission Wednesday, 13 January 2016, 9:30 AM)

Average of ratings: -
In reply to sara HHH

Re: Maximum file upload size

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You want to upload 10G files into Moodle? :-O

There are limits imposed by the internal workings of PHP and Apache (and depend upon the particular build). However, it won't be as much as 10G. In any case, trying to upload files of that size through a web interface is probably not very sensible. What exactly are you trying to do?

Even if you get this working, you'll run into other problems I'm sure.

In reply to Howard Miller

Re: Maximum file upload size

by sara HHH -

i set to 10 GB and now i have in dropdown menu in (Site Policies) 100 MB and 10 GB but i want to have a choice in dropdown menu between these two numbers like 500 MB.and 10 GB option still available for selection if it again a large backup needs to be imported .


Many Thanks

S.K

In reply to sara HHH

Re: Maximum file upload size

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Implement the File_system_repository for when you really do need to upload huge files. 

For everything else, set the maximum upload to be something sensible.

In reply to Howard Miller

Re: Maximum file upload size

by sara HHH -

many thanks .

could you please tell me where the relative code about this drop down menu ( Maximum uploaded file size ) is.

many thanks for your help again.
s.k

In reply to sara HHH

Re: Maximum file upload size

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Look for a function called 'get_max_upload_sizes' in lib/moodlelib.php.

However, I strongly discourage you from hacking core code wink