Hi all,

I was wondering if there was an add-on module anyone was aware of that would give me per-user total file size limits? Coming from the unix world, I'd call it a "quota". It's a way for me to say "Allow each user to upload as many files as they like, as long as the total of all the user's files is < 30MB". The upload module does this, but as far as I can see, native FileField doesn't, and I can't seem to find any add on modules that do.

Any pointers, or is this a potential new module?

Justin

Comments

quicksketch’s picture

FileField itself doesn't support quotas, in fact we actually *removed* quotas from Drupal 7 because it was such an unuseful feature. Quotas essentially punish your users for creating a lot of content. If you want to limit users to a certain file size, usually you'd restrict the number of nodes a user can create, then set a per-file limit. So if a user can create 20 nodes and the file size is limited to 5MB, then they have a "quota" of 100MB. It makes a lot more sense that way than saying "You can create unlimited nodes, but the total file size for all of these nodes is 100MB".

Anyway, so to answer your question, no I don't know of a module that adds a quota restriction to FileField.

justintime’s picture

Makes perfect sense to me. I haven't played with D7 yet, but I'm guessing you're referring to D7 when you talk about "limiting the number of nodes a user can create"? I can't find it in my D6 install. Do you recommend a module for doing this in D6? There's a few of them out there - user_quota, nodelimit, and node_limitnumber look like they all might work.

quicksketch’s picture

I haven't actually used any of those modules, I'd suggest just trying them out or use the one that has most installations. The last time I had to limit the number of nodes a user could create was a few years back, and even then we ended up removing that restriction since users would go back and delete previous content so they could make new content.

justintime’s picture

Status: Active » Closed (fixed)

Cool - thanks for the help (and for all your wonderful modules, and the podcasts, and the book, and ...) :-)

abaddon’s picture

Quotas essentially punish your users for creating a lot of content. - it protects the server too doesnt it? i wont reopen the issue again but.. not everyone is using shared hosting from godaddy with unlimited space
limiting total nodes to 20 is crazy, 20 nodes != 1GB of disk, uploads are sometimes optional, 100 files of 10MB each == 1GB..
ill repost if i find a solution

Ilya1st’s picture

Category: support » feature
Status: Closed (fixed) » Active

I'm writing now bulk node upload - http://drupal.org/project/advupload for nodes per each node type - for large files suppor(e.g. videos, etc.)
So there it's possible create 20 nodes and eat more size so I think sometimes people need even more - per user upload limits.

So in D7 I need this limitation too

quicksketch’s picture

Status: Active » Closed (won't fix)

Too late, neither FileField nor Drupal 7 core support this feature. It's still possible through add-on modules adding custom #upload_validator properties, but this is not going to be added to FileField or core at this point.

Ilya1st’s picture

thanks for idea.
simple admin form + one validator - not too difficult.

dagomar’s picture

Quotas essentially punish your users for creating a lot of content.

Occasionally I can use this word and this is one of those occasions: poppycock :). There are many scenarios where having a quota is a useful feature. Imagine a service that sells web-space, you would want to limit space then. Also the posed solution, 'restrict the number of nodes a user can create' is not a solution at all, what if it is a multiple field?

Anyway, I can totally agree that this functionality should not be part of the filefield module. Probably a custom module can easily do the trick. Or perhaps something like IMCE in combination with filefield through Filefield sources? IMCE limits user quota out of the box... http://drupal.org/project/filefield_sources

Probably the nicest is a custom validator, as was mentioned before.

kressin’s picture

I have to agree with dagomar. I am currently working on a site which allows people to add video and pictures. The concept idea is that a user pays a certain amount for web-space and therefore a quota is mandatory. Has anyone got an idea how to implement this in drupal 7?

Ilya1st’s picture

yes. just write own module for that