Uploding files more than 8MB

Uploding files more than 8MB

by Georges Kaddoum -
Number of replies: 7

Hi all

I need to allow users to upload files that might have a size more that exeeds 8MB

I've changed the values of the "Config" table in the database (maxbytes) and in the "Assignement" table (maxbytes) , and i've cahanged also the values of "UPLAOD_MAX_SIZE" in the PHP.ini file on my webserver as well as i added the "LimitRequestBody" in the httpd.config of appache web server.

all those modifications and it still not accpeting files more that 8MB

what should i do more to fix my problem

thanks for your help

Average of ratings: -
In reply to Georges Kaddoum

Re: Uploding files more than 8MB

by Tony Hursh -
Georges, did you restart Apache after making the changes? If not, entering:

sudo apachectrl graceful

at the command line should do the trick.
In reply to Tony Hursh

Re: Uploding files more than 8MB

by Georges Kaddoum -
Well yes i restarted it and it didn't worked
In reply to Georges Kaddoum

Re: Uploding files more than 8MB

by Tony Hursh -
Georges, there are four places where this is controlled:

1) php.ini (you've fixed this)
2) httpd.conf (you've fixed this)
3) "maxbytes" in http://yoursite/admin/config.php
4) "Maximum upload size" in the settings screen for the specific course.

You shouldn't need to change anything in the database directly.

In reply to Georges Kaddoum

Re: Uploding files more than 8MB

by Ramz p -

I guess there is a spelling mistake in UPLOAD_MAX_SIZE (Urs is UPLAOD_MAX_SIZE)

Check this out.

In reply to Georges Kaddoum

Re: Uploding files more than 8MB

by kevin metcalf -
Just in case anyone else finds this the same way I did (google 'moodle upload 8MB'), I'm adding this post to the end of all threads that don't have all this info (I'll post them here to increase the likelihood anyone searching will find what they are looking for).

There are four things you have to do to ensure this works properly (in some versions of linux). Let's say I want to allow for a 50 MB upload (we've got a photoshop class where student files can easily exceed 8MB). Here are the steps needed to ensure your site can handle this:

1. Update /etc/php.ini (or where ever your php.ini file is) to reflect TWO changes:
* upload_max_filesize = 50M
* post_max_size = 50M
2. Update apache's config file in /etc/httpd/httpd.conf (or where ever your httpd.conf file is located):
* LimitRequestBody 51200000
3. Restart apache:
* apachectl stop
* apachectl start
4. Update the Moodle Course Variables entity. (Do this last or you won't be able to see the new size options).
(NOTE: A simple restart didn't reload the modules correctly for my system, YMMV.)

Googlers may also be intested in knowing that browsers don't always respect the upload limit and may try to upload a file that is too large. There are applets on the market (and probably free by the time you get this) which will check in advance to make sure the file is the proper size before uploading - thus saving bandwidth.
Average of ratings: Useful (1)
In reply to kevin metcalf

Re: Uploding files more than 8MB

by Don Hinkelman -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Hi Kevin,

Thanks for the little help file for this common question.  You might go and add your notes to the documentation wiki as well.  You know, it is like Wikipedia--anyone can add.

Some added points to note...
  • Apache 1.3 (at least mine) does not need to be modified.  There is no line called LimitRequestBody.  Just modify php.ini.  
  • In Apache 2, you probably need to modify or add this line  LimitRequestBody 0   (the last number is a zero).  I doubt there is a need to make the limit at 51200000.  And writing zero is easier.  smile
  • On hosting services, you probably won't have access to php.ini, so make a file called php.ini in a text editor and place those two lines in it.  Then put a copy of that php.ini in *every* folder in Moodle that might be concerned with file uploads (ie:  /mod/forum    /mod/assignment   ).

Average of ratings: Useful (1)