max_size and min_size validation for `forms.fields.FileField`
- Dominant language
- No language data
- Stars
- 188
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
### Code of Conduct
- [x] I agree to follow Django's Code of Conduct
### Feature Description
hi
adding validation for max size and min size of files
### Problem
since files can be uploaded by users, having some validation on them could become necessary for developers
### Request or proposal
proposal
### Additional Details
this was discussed in https://forum.djangoproject.com/t/proposal-max-and-min-size-validation-for-filefield/43232 and https://code.djangoproject.com/ticket/36685
we already get size of the file in the `to_python` method in form field and check for empty files
might just turn it into checking both side of size
### Implementation Suggestions
this could be either a validator function that will be added to list of validators
or a parameter to `FileField` itself, which could be validated in the `validate` method
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.