Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#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 Antoliny, 11 months ago

Thank you for suggesting this improvement.
However, I believe there was a similar issue raised before, maybe a duplicate ? #34700, #34263, #33942

comment:2 by amirreza, 11 months 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

Last edited 11 months ago by amirreza (previous) (diff)

comment:3 by Natalia Bidart, 11 months ago

Cc: Adam Johnson 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.

Duplicate of #34700, #34263, #33942.

Last edited 11 months ago by Tim Graham (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top