Site-wide settings for file upload size - where have they gone in 1.7?

Site-wide settings for file upload size - where have they gone in 1.7?

by Fiona MacAlister -
Number of replies: 21

I have changed my php.ini file to make larger file uploads possible, but cannot seem to find a section in Moodle 1.7 in which I can change the site-wide settings for uploading files.  Does it still exist or is there something else that one needs to do?

Average of ratings: -
In reply to Fiona MacAlister

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Mauno Korpelainen -

You can change it with Administration > Modules > Activities

and select settings for Assignment and Forum.

In reply to Mauno Korpelainen

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Kyle Brown -
What can it be maxed to? My php.ini is set to 100 or 10 MB but I can only do 8 MB in moodle and course settings. Anyway I can change this is maybe 10 or more MB?
In reply to Kyle Brown

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Mauno Korpelainen -

I have used 32 MB. If you can only change it to 8 MB in moodle but want to have 100 MB check the following:

in apache (httpd.conf or
apache2.conf) set the LimitRequestBody to 0
or something like LimitRequestBody 104857600

in php.ini

upload_max_filesize =  100 M
post_max_size = 100 M
memory_limit = 100 M

You may also need to change in php.ini next values (add some 0)

max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data

Remember to reboot server to get those settings to work.

In reply to Mauno Korpelainen

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by JR Renna -

I have come upon this problem as well. I am running moodle 1.8

I made all of the above changes to php.ini

Neither my httpd.conf or apache2.conf had a line for LimitRequestBody, so i added it to httpd.conf with the 104857600 value.

Under Security > Site Policies, The max upload limit reflects the 104857600 value, however, under Modules > Activities > Assignments, the highest limit that can be set is 2MB.

When you try to upload an assignment it says the max size is 100MB, however, when you try to upload a file greater than 2MB, it returns the error : Course module is incorrect.

How can i force the modules to be in line with my apache, php, and site wide max upload size?

In reply to JR Renna

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Richard Kuhnel -
I am wondering - I made all the changes suggested using a .htaccess file. When uploading a file over 500KB I get a message that the server was reset. Here the error message:

The connection was reset
The connection to the server was reset while the page was loading.
* The site could be temporarily unavailable or too busy. Try again in a few
moments.
* If you are unable to load any pages, check your computer's network
connection.
* If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.

I have version 1.8 installed on a Linux server (shared hosting). I changed the settings in security->sitepolicies to 41943040 (equals 40MB) for Mazimum Uploaded File size. I checked in the course settings and set it there also to 40 MB.
As I am in a shared environment I created a .htaccess file and set the following parameters

LimitRequestBody 41943040
php_value port_max_files 40M
php_value upload_max_files 40M

both in the moodle and moodledata directories.

I can upload large files on to the server using ftp.

Does anyone know what I am doing wrong?

In reply to Richard Kuhnel

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Mauno Korpelainen -

Richard,

if your webhost is using phpsuexec:

http://moodle.org/mod/forum/discuss.php?d=67989

In reply to Mauno Korpelainen

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Richard Kuhnel -
Thanks Mauno.
I tried to put a php.ini in the files directory. It did not change anything for uploading using the files link form the course administration block. I will check with host provider on phpsuexec.
I played around with upload_max_filesize etc. It is really weird even if I set the file_uploads to off, still the same problem, but I also can still upload files smaller than 500KB.

I am at a loss. I don't know what else to do.
In reply to Kyle Brown

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Just H -
Hi Kyle

Not sure what the limit is, or even if there is such a thing, but I have one site quite happily running with a 250MB limit.

Guessing the 8MB limit you have hit is due to not changing the post_max_size (see the reply from Mauno).

H


In reply to Fiona MacAlister

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Fiona,

The maximum uploaded file size in 1.7 may be changed via Administration > Security > Site policies. The maximum upload file size for particular activities may then be set as Mauno describes.
In reply to Helen Foster

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Mauno Korpelainen -

Thank you for that supplementary information, Helen!

And there is one more place to make it - course settings.

In reply to Mauno Korpelainen

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by Fiona MacAlister -
Thanks for the info everyone!  Thought I was going nuts when I couldn't find the correct place to change it.thoughtful
In reply to Fiona MacAlister

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by John Hobson -
Sorry If I am being dense.

I am installing Moodle 1.8.2 on a new server via Fantastico - shared hosting so I don't seem to have access to the low level apache files mentioned here.

It won't let me upload a back up file from my other server as it says the limit is 2Mb

I have set the Maxbytes to 100000000 but that doesn't seem to have any effect

Can anyone tell what to do in this circumstance. (I am not VERY techy ;-egg and haven't been able tow work it out even after searching high and low round here!)

Thanks in advance

John


In reply to John Hobson

Re: Site-wide settings for file upload size - where have they gone in 1.7?

by John Hobson -
Sorry - In case anyone else is in the same boat I solved it by contacting my hosting provider who set the .htaccess file limit higher themselves. I think I could have done it myself If I were more competent wink
Average of ratings: Useful (1)
In reply to John Hobson

Upload Problems, please help

by Rajat Mittal -
I have read lots of posts regarding increasing the upload size within moodle.However, for me its still not working.

Here are my current settings :

Running Apache2 with PHP 5.2 on Ubuntu.
Moodle version 1.8.2

LimitRequestBody 0 in httpd.conf [I added this line in it asthe file was initially empty]

(in php.ini)
post_max_size 20M
upload_max_size 20M

My php.ini is at one place only. Some forum answers suggest copying it to several places. I am not sure where to copy though.

Then, Security>Site Policies> maximum upload size is 20971520 ( for 20M ).

However, I still get an upper limit of 2M in the course settings and hence, cant upload a document of bigger size.

I have restarted the server as well several times. No effect.

Someone kindly help me out. I have lost all hope of figuring this out.

In reply to Rajat Mittal

Re: Upload Problems, please help

by Javier Quinteros -
Rajat,
It seems that there is a lot of people with this problem. I've recently posted here:
http://moodle.org/mod/forum/discuss.php?d=104529
but there is still no answer. Maybe if you take a look at the post that can help you to see the other parameters that can affect your maximum upload file size.
Unfortunately, that is not working for me. I cannot even upload a 512KB file and I'm starting to despair because there is no solution.
In reply to Rajat Mittal

Re: Upload Problems, please help

by Chris Holland -
I'm having the same problem :@

Listened to all the advise about changing settings in php.ini, messed around with moving files, but still have the same problems.

If someone finds a solution to this I'd be very grateful.
In reply to Chris Holland

Re: Upload Problems, please help

by Hayden Middlin -
I have got this working on our Mac OS X.5 server.
I changed the Max file upload file size in the php.ini file in the /etc folder.
I then changed the maximum upload file size in Moodle under Admin/Security/Site Policy.

I then changed the max file size setting under Courses/Course Default Settings.

I am running Moodle 1.9
In reply to Hayden Middlin

Re: Upload Problems, please help

by UN AUS -
Hi,

Can someone tell me where is located the php.ini file, that needs to be modified?

Thanks in advance!!!!

Kata
In reply to UN AUS

Re: Upload Problems, please help

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Kata,

This will depend on a number of things. If you go to Administration > Server > PHP info it should tell you the location of your loaded php.ini file.

Jon
In reply to UN AUS

Re: Upload Problems, please help

by Colin Fraser -
Picture of Documentation writers Picture of Testers
Failing that, it should be in the PHP folder. However, you may want to look at this Beginning Administration FAQ. That will get you going in the right direction.
In reply to Colin Fraser

Re: Upload Problems, please help

by UN AUS -
Thank you, Jon and Colin!

In the end I called the webserver tecnicians and they changed the value.

The FAQs will be surelly useful in the future! smile

Kata