file_upload_max_size() returns upload_max_filesize in number of bytes, but the documentation (for both Drupal 5 and Drupal 6) wrongly tells it's the number of megabytes. This is probably a left-over from Drupal 4.7.

The upload module was not updated for this and uses the returned value as if it was a megabyte count.

Attached patches fix this for Drupal 5 and Drupal 6 (doxygen update + upload.module fix)

Comments

asimmonds’s picture

Status: Needs review » Reviewed & tested by the community

When looking at the typo issue in http://drupal.org/node/206418, I noticed some of the size checks weren't quite right, which this patch fixes.

The D6 patch looks OK, applies and tested correctly (haven't looked at the D5 patch, waiting until this is committed to HEAD first)

dries’s picture

Version: 6.x-dev » 5.x-dev

I've committed the Drupal 6 patch. Good catch. :)

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x.

sethcohn’s picture

Status: Fixed » Needs review

Having the problem where we're able to upload files larger than the set upload size (ie 2 megs, when the filesize limit is set to 1 meg limit) without an error,
and worse, failing silently (no error) when the filesize is larger than the php filesize upload limit.

I was hoping (and it looked like it would) that this patch, now in 5.6, would fix the problem, but it's made no difference - same errors (or lack thereof) continue with the above patch.

Any ideas?

webernet’s picture

Status: Needs review » Fixed

@sethcohn - That's a different issue - http://drupal.org/node/30520

This issue is fixed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.