Basic IFormFile model validation attributes #47809
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
Milestone
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
No response
Describe the solution you'd like
It would be nice to have a model validation attribute like
MaxFileSizeAttribute
onIFormFile
fields to validate the file size.It might also be nice to have a
FileExtensionsAttribute
(like the one in System.ComponentModel.DataAnnotations) that works on IFormFile types by looking at the file name. Although this would not suffice as proper validation, it could serve as basic validation before checking the actual file content.Additional context
Related to #8573
The text was updated successfully, but these errors were encountered: