Would be really nice to be able to limit file size of an uploaded file (or even set limits role-driven) per file, e.g. one file cannot be bigger than 1MB. And size limits per node if file field is used in multiple values mode, e.g. size of all uploaded files for 1 node may not be bigger than 5MB.

Comments

jpetso’s picture

Priority: Critical » Normal

I read this issue as not being a duplicate of #150393, because that one is concerned with site-wide upload limits and this request wants per-field settings for upload limits. Therefore, valid issue, but certainly not critical.

dopry’s picture

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

This would be a super cool feature.... Lets try to get this into a 2.3 release

hillaryneaf’s picture

This is a much needed feature!

subscribing..

greg.harvey’s picture

Status: Active » Fixed

Done.
http://drupal.org/project/filefield_upload_limit

There is intention to submit this as a patch to filefield.module, but I haven't had time to write the patch yet. So for now you will have to use the module.

jpetso’s picture

I now extended FileField for Drupal 6 with per-file and per-node file size restrictions. That should probably satisfy most use cases, and those use cases that are not satisfied can be added by add-on modules that implement the new hook_filefield_filesize_restrictions(). (The only thing that is less flexible with this solution is the settings form that can't be altered, because I removed that alter hook in favor of file widget setting hooks. Might add it back if necessary, or perhaps CCK should offer such a hook. Anyways, that's secondary now.)

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

ipto’s picture

I set 500K for file size limit, but file with size = 800K was uploaded successful. FileField version at jul 31