ASP.NET Core 7: Better file upload integration with Swagger on Minimal APIs

added by DotNetKicks
3/20/2023 2:54:52 PM

453 Views

Uploading a/several file(s) was extremely easy with ASP.NET Core MVC and ASP.NET Core WebAPI. These framework provided interfaces IFormFile to upload a file and handle it server-side and IFormFileCollection to handle several files. Unfortunately before ASP.NET Core 7, these interfaces were not available on Minimal APIs and you had to fetch files into the HttpRequest.Forms object which disallowed you to upload file with Swagger.


0 comments