#36685 closed New feature (duplicate)
`max_size` and `min_size` validation for `FileField`
| Reported by: | amirreza | Owned by: | amirreza |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Normal | Keywords: | form FileFIeld files |
| Cc: | amirreza, Adam Johnson | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
hi
as disccussed in forum, i think a max_size and min_size validation could be a good addition to django
or at least max_size
should mention i can do this one myself
i'm fine by doing it as a paarameter in FormField, or as a validator function
so if you have a preference, please do tell
should mention anything discussed here also applies to ImageField and anything else inheriting from FormField
Change History (3)
comment:1 by , 3 weeks ago
comment:2 by , 3 weeks ago
hi
sorry these ones didn't show up in my searches here
tho, i only propose a size validation, which is something django can do natively and easily,
and not mime type, which would need using a package
there's also already a django 3rd party package for checking mime type, but not size
comment:3 by , 3 weeks ago
| Cc: | added |
|---|---|
| Easy pickings: | unset |
| Resolution: | → duplicate |
| Status: | assigned → closed |
Thank you Antoliny for the accurate triage. This is indeed a duplicate and also a new feature, so before considering reopening any of the older tickets, the new feature should be proposed and discussed with the community. To do that, please raise this on the new feature tracker.
Thank you for suggesting this improvement.
However, I believe there was a similar issue raised before, maybe a duplicate ? #34700, #34263, #33942