I have a problem with uplaoding, it says "Your PHP settings limit the maximum file size per upload to 4 MB." even though I have set the php.ini to a higher limit. It was originally 2mb, but i changed the php.ini to 100mb, but now it shows the limit as 4MB?

Also, it was only this particular site having this problem. My previous drupal installations - all running on the same server - did not have this limit.

Where have things gone wrong?

Comments

ac’s picture

You may need to change post_max_size and upload_max_filesize to suit. Also did you restart apache after making these changes?

------------------------------
Alex Cochrane
Spoon Media

PipSqueak’s picture

yes, thanks for reply. I did restart apache but it still reads 4mb. other installations did not have this limit.

ac’s picture

sorry i edited that post whilst you were replying.
------------------------------
Alex Cochrane
Spoon Media

PipSqueak’s picture

OK thanks, I did as you told and there is improvement - it now says 25MB.

But weird, I set both as 50MB haha. You think if I put it at 100MB it will be 50MB?

ac’s picture

Probably, although I think you will find just increasing the post_max will fix your problem. These are pretty huge files to be uploading. You may want to change your timeout settings as well.
------------------------------
Alex Cochrane
Spoon Media

PipSqueak’s picture

Thanks for the reminder. Actually we need to work with on average 10mb but the extra acts as a margin of error (we're dealing with non-computer literate people).

Problem solved.

PipSqueak’s picture

Geez, putting both at 100mb will become 50mb. this is odd.

Anyway thanks for the help I can get on with my work.

henwoodr’s picture

I am having the same problem with the new install of Drupal 5.0. I have no idea where that line of code is to edit.

arthurf’s picture

Drupal halves the value of post_max_size
$post_max = parse_size(ini_get('post_max_size')) / 2; (file.inc)
which while probably smart to decrease problems with uploads, might be nice to have a bit more clear reporting to the administrator what needs to be changed to increase this value.

Perhaps change upload.module line 152 to include the same text that is displayed if you try to set the value greater, from:

 $form['upload_max_size'] = array('#value' => '<p>'. t('Your PHP settings limit the maximum file size per upload to %size MB.', array('%size' => file_upload_max_size())).'</p>');

to:

 $form['upload_max_size'] = array(
  '#value' => '<p>'. t('Your PHP settings limit the maximum file size per upload to %size MB.', array('%size' => file_upload_max_size())).'</p>'.
                     t("Depending on your sever environment, these settings may be changed in the system-wide php.ini file, a php.ini file in your Drupal root directory, in your Drupal site's settings.php file, or in the .htaccess file in your Drupal root directory. Drupal allows uploads that are 50 percent of the allowed upload size."),
);

I'm not sure if this is the best text to use, but it seems a bit awkward to display the help text only when the user submits a value greater than the max allowed. If this was display initially, it might be more clear to the administrator what the issue is and how to resolve it.

brashquido’s picture

Thanks for tracking this limit down arthurf, it was starting to drive me nuts. I also agree that Drupal should say something to the effect that it is building in a margin of safety or something rather than this;

Your PHP settings limit the maximum file size per upload to x MB.
Depending on your sever environment, these settings may be changed in the system-wide php.ini file, a php.ini file in your Drupal root directory, in your Drupal site's settings.php file, or in the .htaccess file in your Drupal root directory.

This is VERY misleading when you know for a fact you have your php.ini limits set at or above the limit you need and are still getting an error message suggesting it is your settings rather than Drupal inserting it's own hidden margin of error.

----------------
Dominic Ryan
www.iis-aid.com

jmcclelland’s picture

This has been reported as a bug here:

http://drupal.org/node/104220

And here:

http://drupal.org/node/72545

As a comment that apparently got ignored.

It seems as though this isn't fixed in 4.7 or 5.1.

I don't think 50% makes any sense - I think it should more like 90%.

siaiweb’s picture

You are indeed limited to the half of your post_max_size (php.ini in your php folder) for every upload. That's a regular php rule, nothing odd here. It's for multi-upload purposes: none of your uploads can exceed half of the total allowed size...
You should also consider to extend your timeout limit if you wanna upload big files ( > 25 Mb), as written in another comment.

Francis Pilon’s picture

What do you mean? Why couldn't an upload be larger than half the total allowed size?

Thanks
FnL

texas-bronius’s picture

Just a theory: perhaps max post = 1/2 max upload b/c it is an easy number that would still allow for plenty other form-post variables (and even add'l files). Upload Max itself is just a single file's cap (I think), and a single form-post can handle several file uploads.

--
http://drupaltees.com
80s themed Drupal T-Shirts

ceege111’s picture

There is no error when uploading a file that is too big - it just poops out and shows as not attached.

C.J.