Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks 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, 3 weeks 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, 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

Last edited 3 weeks ago by amirreza (previous) (diff)

comment:3 by Natalia Bidart, 3 weeks ago

Cc: Adam Johnson added
Easy pickings: unset
Resolution: duplicate
Status: assignedclosed

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 3 weeks ago by Tim Graham (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top