max upload size

max upload size

by David Kelly -
Number of replies: 4
I'm using moodle 1.2 development (2003091800)

I am trying to upload my backup from a 1.1.1 install to this new 1.2 install ... The backup made in 1.1.1 is around 9 megas.

I see in this new install that I have a 2meg upload limit.... as this is a cpanel autoinstall of moodle I am not sure if its a serverwide php setting or a moodle setting. The provider gives no support on moodle issues.

I searched in the forum and faq .... In the forums amongst many other older threads I saw
a possible solution to my problem .... "adjust the maxbytes setting in administration / Configuration / Variables" .... I duly looked and its not there... should it be?

Can someone give me a hand here? if there is a file I can edit without getting involved with php.ini all the better!!

all the best
David



Average of ratings: -
In reply to David Kelly

Re: max upload size

by David Kelly -
Well ... looks / feels like everyones tired of file upload questions!!!!!

Maybe someone could get this and all other accumulated forum info filtered and into the FAQ?? I have found it quite a hard issue to "see" clearly in the forums... as far as I could work out different moodle versions have applied different approaches, some were endorsed, others weren't.

This issue (which stopped me uploading and restoring a complete 9 meg backup with all the associated docs and data) was solved promptly by my host upping the php user_max_filesize attribute to 25meg ... they warned me it may well have to come down again in the future if my (shared) server shows signs of strain... we shall see.

all the best to everyone, especially Martin and the moodle coders and contributors!
David


In reply to David Kelly

Re: max upload size

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
To be honest, if you have a webhost then they are really the people who should be solving these PHP-level problems (as you discovered). The FAQ entry on 'upload size' is pretty comprehensive and does contain all known solutions...
In reply to Martin Dougiamas

Re: max upload size

by David Kelly -
yep thats true, it does, but only if you check the "search all text" option which I had overlooked ...I had clicked "U" and found just one entry "Uploaded files give "File not found" ... then I did a search for "upload file size" without checking the search full text box (fairly easy to do with not perfect vision) and drew a blank.... "No entries found in this section"
I then went on and searched in the forums and as you know got all sorts of threads.

Top and bottom of it is that this is a host issue and not a moodle issue, I just think it would be better for all if the excellent available info was a little bit easier to get to.

all the best
David


In reply to David Kelly

Re: max upload size

by Timothy Takemoto -
I had trouble with this too. There seem to be a lot of things said about this but I could not get them to work. Most course backups are going to be bigger than 2M, so this is something that one would like people to be able to manage easily. It is easy in fact but it took me a while to figure it out.

I could not find the "php user_max_filesize" that David Kelly refers to. I presume that this is a server setting but as far as I know there are only the two settings that Martin mentions in my php.ini.
I changed both of these.
php_value upload_max_filesize 50000000
php_value post_max_size 5000000
Also I do not have a "limitreqestbody" in either of the httpd.conf or php.ini.

Additionally, I cannot increase the size on the moodle site administrationb page since it is a dropdown menu with the maximum at 2M.

I am not sure what the neck because I do not know whether there is some setting internal to moodle (i.e. a variable called "maxbytes") or whether the maxbytes simply changes the values in php.ini.

However, I have solved this problem by downloading directly into the moodle data directory. I created a folder called "foldername" and this could be found in the following position.

moodledata/1/foldername

If you down load directly into moodle then there is no need to upload. Since it is likely to be backupfiles that are going to go over the limits, perhaps this should go in a FAC somewhere.

I have written a fac entry which I feel confident will not be approved (perhaps I should post it to the documents course?), so I append it here for users reference.

Restoring Large Files
Course backup files can become very large, far exceeding the limit ("maxbytes") set on files to be uploaded into Moodle site files.

Changing the maximum 'upload size' (click to see the explanation of how to do this in the FAQ) is one way around this, but it may not be a good idea to increase this limit to the sort of level required by large backup files.

A simpler method of getting around the maximum file size restriction is

1) If you are using the moodle server then simply download course files the moodledata directory (site files are in directory 1, course files are in subsequnetly numbered directories)

2) If you your Moodle server is remote then upload the file into the Moodledata directory using ftp. If you create a directory called "backup" in the moodle site files, then you can put things directly into it by ftp to
moodledata/1/backup
where moodledata is the directory containg moodle data for your moodle installation.

Reload your moodle browser to see the new uploaded contents.


******************************************************

Perhaps, for those teachers that want to be able to use the Moodle GUI it would be nice if there were a "100MB" or so option in the maxbytes dropdown menu?

PS
I had the idea that I needed to restart apache for the changes I had made to php.ini to take effect. This seems to be the case. HOWEVER, when I applied the changes by restarting apache, it could not restart. Now that I have change the two of these
php_value upload_max_filesize 50000000
php_value post_max_size 5000000
back to "2m" and now I can restart apache. Hmm.... this is strange, probably something stupid on my part. But anyway, perhaps the words "and restart apache" might go into the upload size fac. Perhaps not.

Tim

Timothy Takemoto