Closed (fixed)
Project:
Drupal core
Version:
5.x-dev
Component:
upload.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2007 at 17:40 UTC
Updated:
25 Jan 2008 at 20:12 UTC
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)
| Comment | File | Size | Author |
|---|---|---|---|
| file_uplad_max_size_D5_1.patch | 2.83 KB | soxofaan | |
| file_uplad_max_size_D6_1.patch | 2.84 KB | soxofaan |
Comments
Comment #1
asimmonds commentedWhen 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)
Comment #2
dries commentedI've committed the Drupal 6 patch. Good catch. :)
Comment #3
drummCommitted to 5.x.
Comment #4
sethcohn commentedHaving 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?
Comment #5
webernet commented@sethcohn - That's a different issue - http://drupal.org/node/30520
This issue is fixed.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.