how to increase the upload_max_filesize

oskar_calvo - March 6, 2007 - 16:14

Hello, i have change the upload_max_filesize in my php.ini file, but i´d like to know if i have to change something else in drupal.

thanks.

That should do it

ronan - March 6, 2007 - 18:22

If you are using the Upload module, that should be all you need. Other modules may implement their own limits. To check if your upload_max_filesize setting took, create a file called info.php in your drupal dir with the following code in it:

<?php
phpinfo
();
?>

and view it in a browser.

If it is not working you can try adding

php_value upload_max_filesize              32M

to your htaccess... change 32M to whatever number you like.

Hope this helps

------------------------------------
Gorton Studios - Websites that Work. http://www.gortonstudios.com/
http://www.gortonstudios.com/portfolio/technologies/drupal

Thanks ronan for the

fideaux - March 14, 2008 - 21:17

Thanks ronan for the info.php tip. Made troubleshooting easier.

(For the record, everyone, adding php_value upload_max_filesize 32M and php_value post_max_size 64M to the .htaccess in Drupal root was the trick. No php.ini change needed. This is a D6 install.)

My experience tells me the

Imago - March 23, 2008 - 16:57

My experience tells me the opposite. No changes in .htaccess work, while uploading a php.ini in the root changed everything. For instance

post_max_size=32M
upload_max_filesize=32M
max_execution_time=180
max_input_time=120

...

jscoble - March 23, 2008 - 17:58

I agree, if you can modify php.ini, I think that would be the preferred route.

Some additional notes:
The post_max_size should be greater than the upload_max_filesize, otherwise files that are the maximum filesize may fail because the upload_max_filesize + header > post_max_size.

If multiple file uploads on a single post are going to be common you will probably want to make post_max_size equal to a multiple of upload_max_filesize.

Make sure your max_execution_time is long enough to both upload the file and copy the uploaded file from the tmp directory to the destination directory. This setting is in seconds. To figure out how long it needs to be figure out how long it will take to upload the file given the expected upload speed, e.g. 128Kbs, and set the max_execution_time to a value slightly higher than that. Remember a Byte(B) is 8 bits(b).

If your using session management, remember to set the session.gc_maxlifetime is large enough to allow for the session to upload and copy the post_max_size

Have a look at this page:

jbrown - April 14, 2008 - 20:43

Have a look at this page: http://www.radinks.com/upload/config.php

--
Jonathan Brown
http://openpackage.biz/

 
 

Drupal is a registered trademark of Dries Buytaert.