Closed (won't fix)
Project:
Drupal core
Version:
4.6.0
Component:
upload.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2005 at 15:20 UTC
Updated:
29 May 2005 at 22:39 UTC
I think there's a problem in upload.module, around here:
$maxsize = variable_get("upload_maxsize_total", 0);
$total_size = upload_count_size() + $filesize;
$total_usersize = upload_count_size($user->uid) + $filesize;
if ($maxsize && $total_size > $maxsize) {
form_set_error('upload', t('Error attaching file %name: total file size exceeded', array('%name' => theme('placeholder', $file->filename))));
break;
}
If upload_maxsize_total is the default (0, unlimited) then we have no problems. However, if we follow instructions on the upload settings page, and change this to, say, 1 megabyte, the comparison:
$total_size > $maxsize
will (almost always!) fail, as we're comparing the file size in bytes to a value we are told to input in megabytes.
Comments
Comment #1
David Hull commentedYes, I noticed the same problem. Here's my fix:
Comment #2
pfaocleThats what I did, but I didn't submit a patch as it may not be the nicest solution. The upload settings should probably remain in Mb (or perhaps Kb?). Any thoughts from the maintainers?
Comment #3
pfaocleBumping - still applies in HEAD.
Comment #4
Steven commentedCommitted to 4.6 and HEAD.
Comment #5
(not verified) commentedComment #6
iraszl commentedI've tried to download the cvs 1.39 version of the upload.module with the fixed "upload size". Replaced the upload.module, but it still not works. Also, when I try to check the upload settings, nothing loads. Looks like the module is broken on my system. Is there anything I need to know as how to replace the original 4.6.0 upload module with this cvs version?
Reference:
http://cvs.drupal.org/viewcvs/drupal/drupal/modules/upload.module?rev=1....
Comment #7
Steven commentedThe most important thing: modules do not work across major Drupal releases. HEAD has already had significant changes which break 4.6 modules;