Community & Support

Maximum file size upload problems, please help!!!

The maximum file size per upload, is by default set to 2 MB, I changed this to 5 MB, and I couldn't upload a 2.2 MB zip file. I have zip files included in my permitted file extensions, and I have the same settings for defaultand for authenticated user role. Anyone else had this problem?? Anyone knows how I can solve it. My site is already live and I already had one person who told me he tried to upload a file and couldn't. It doesn't give you a error or anything, it just loads the file for some time and then it shows nothing. If I upload a file of 1.8 MB ther is no problem. Please help me!!!!!

Comments

Maximum filesize

It's probably the limit set by your PHP install. You can up that limit by adding:

  php_value upload_max_filesize 20M
  php_value post_max_size 20M

into the .htaccess file in the mail Drupal directory. You need to add that code in the block of code that relates to the version of PHP and apache you're using.

The example above ups the limit o 20mb

Hope that helps

Joe

Could you possible post a

Could you possible post a example of where to past

php_value upload_max_filesize 20M
  php_value post_max_size 20M
in the .htaccess file? I dnt work with the file alot so i am a little lost =/

You didn't say how you tried

You didn't say how you tried to change it. Anyway... hopefully I an not repeating things that you already tried.

If you have access to php.ini or you are allowed to use a modified copy of php.ini, add two lines like the following at the end (example for 16MB files)

upload_max_filesize = 16M
post_max_size = 18M

If you can't use a php.ini, then you can add two lines in your .htaccess file

php_value upload_max_filesize 16M
php_value post_max_size 18M

If that doesn't work either, then you are out of luck. The third method, with set_ini() lines in Drupal's settings.php, never works in this case.

doesn't work

Hi,

I did both of this solutions and it doesn't work.
I don't understand a thing :

When I look phpinfo() from a test page .php at the root of my site, the variables are changed
but when I look from /admin/logs/status/php, the variables are not changed !
Hmmm ...?!

Why the variables don't update in Drupal ?
What can I do for ?

Thank all
____________________________________
D;)

____________________________________
D;)

(no title)

The php.ini file solution works for me, but only if I copy the php.ini file to drupal's installation directory (which is its own domain web root, not accessed as a subdirectory).

I have also found that Drupal does an additional "sanity check" and restricts the max file size to no more than half the post_max_size, so in my example Drupal would accept only 9M as max file size.

Thank you ! it works fine

Thank you !

it works fine now ! ;)
____________________________________
D;)

____________________________________
D;)

Having the same problem, hope

Having the same problem, hope this works =] Thanks

thanks!!

Thanks to both of you!!! I actually just read the second post but I fixed my problem at around the same time the last message was posted, LOL. But thanks guys, I started looking around in the forums and read about the php.ini file, and changed that and now everything works perfectly. Cheers guys! I do have another problem though with the images of one user in my site they get repeated, my post is here: http://drupal.org/node/157214

Nicolas
-------------------------
http://nic.ipwa.net

The final official end of day working solution

So that everyone knows ... and this can be settled:

1. Changing the settings.php file did nothing for me and most likely will not for you
2. The solution, was simply to create a php.ini file in the site root and add your settings such as:

upload_max_filesize = 32M
post_max_size = 36M

Remember, Drupal will only take about half what the setting allows by default.

I was curious about the

I was curious about the "half what the setting allows" problem (half the size is reported as allowed in Drupal's /admin/settings/uploads page). The numbers I posted previously were just taken from somewhere on the net. So, I did some testing and found that:

32 and 32 results in 16
32 and 36 results in 18
32 and 64 results in 32
32 and 100 results in 32

So, if this proves anything, you get:
- no more that what upload_max_filesize says
- no more than half of post_max_size
(whichever is smaller)

So, the right numbers for up to 32MB files seem to be:

upload_max_filesize = 32M
post_max_size = 64M

This is just an empirical observation without any knowledge of what is going on. Not sure if it applies always.

=-=

built in insurance in drupals file.inc that you don't exceed your maximum server upload settings see: http://drupal.org/node/104220

nobody click here