Currently, there is no way to give an "unlimited" value to the "Default total file size per user:" setting in the File Uploads settings menu.

When I set this setting to a value of 0, which is logical way of saying "the user has unlimited file space on this site", I receive the following two errors:

* The default file size limit must be a number and greater than zero.
* The default maximum file size per upload is greater than the total file size allowed per user

The install is a default 5.0-beta install, no additional modules or changes made.

Comments

webernet’s picture

Title: No Unlimited option » Add unlimited option for "total file size per user"
Version: 5.0-beta1 » 6.x-dev
Category: bug » feature
webernet’s picture

Version: 6.x-dev » 7.x-dev
webchick’s picture

+1 to this. I've had to raise the upload limit on d.o 3 times since the ifac stuff got committed.

aclight’s picture

subscribe

scoutbaker’s picture

subscribe

mfb’s picture

StatusFileSize
new1.17 KB

The upload settings form limits us to 99999 MB (~100 GB) per user including the anonymous user. I attached a drupal 6 patch to allow 9999999 MB (~10 TB) per user; although if this won't be accepted in drupal 6 I should probably just fix via form alter. Of course unlimited is the real answer.

Susurrus’s picture

I think this is the wrong way to go about this. I think that a value of 0 should be allowed like Syn said, which is a common way of saying unlimited. A little bigger patch would be needed for this, but it wouldn't take too much work.

mfb’s picture

Status: Active » Needs review
StatusFileSize
new3.89 KB

Here's a patch adding the feature for drupal 7.

Susurrus’s picture

So that patch handles settings the max file size to 0, but what about actually using that value in the upload validation code where the check against the user's total file quota usage is calculated? Since 0 really mean 999999999999..., I would think there needs to be some special logic to handle that.

mfb’s picture

As far as I can tell, the logic already handles a "zero" as unlimited correctly. I did some quick smoke testing and it seems to work, but it should have some more testing.

dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks mfb. Rock on.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

kleung11’s picture

StatusFileSize
new3.78 KB

I backported the drupal7 patch that mfb made to Drupal5. Testing shows that it works correctly.

joachim’s picture

Version: 7.x-dev » 6.x-dev
Category: feature » bug
Status: Closed (fixed) » Active
StatusFileSize
new4.5 KB

This is a bug on 6 -- reopening.

A bug because the code clearly is written with this in mind:

    // A zero value indicates no limit, take the least restrictive limit.
    $file_size = variable_get("upload_uploadsize_$rid", variable_get('upload_uploadsize_default', 1)) * 1024 * 1024;
    $file_limit = ($file_limit && $file_size) ? max($file_limit, $file_size) : 0;

    $user_size = variable_get("upload_usersize_$rid", variable_get('upload_usersize_default', 1)) * 1024 * 1024;
    $user_limit = ($user_limit && $user_size) ? max($user_limit, $user_size) : 0;

but the UI is not.

Rerolled the patch from #8 above (but without the text on 'least restrictive limit' which is useful but patch creep).

joachim’s picture

Status: Active » Needs review

Oops. Setting to needs review.

jaypan’s picture

Bump - the quota can still not be set to zero in Drupal 6

TimG1’s picture

subscribing.

domosapiens’s picture

+1 for this up. This would be very usefull.

Mateo1041’s picture

Subscribing.

quitos’s picture

+1

dddave’s picture

+1 don't help nobody. If anybody wants this in, please review!

http://drupal.org/patch/review

akalata’s picture

Tested, works for me in 6.19.

Status: Needs review » Needs work

The last submitted patch, 93154.drupal.upload.fixui-unlimited.patch, failed testing.

spike22’s picture

StatusFileSize
new1.95 KB

I was thinking and searching about this and wondering why do the administrators need to restrict the total amount. There should be a choice to let them configure by themselves, not because of the system need. I personally agree with others that this choice should be in the core upload module too. The system shouldn't be that strict, and the admins should be able to choose the zero amount as unlimited. It's kinda freedom thing :) "If you want to limit, you can, but by default there isn't any limit..." If anyone still needs the modified upload.admin.inc file, than that can be found in the attachment (replace it with the original core's file and there u go).

kressin’s picture

Status: Needs work » Needs review

#8: upload.usersize.patch queued for re-testing.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.