dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.45k stars 10.03k forks source link

Basic IFormFile model validation attributes #47809

Open cmg2146 opened 1 year ago

cmg2146 commented 1 year ago

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 on IFormFile 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

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.