ASP.NET Minimal API File Uploads
Implements secure, high-performance file upload endpoints and streaming in ASP.NET Core minimal APIs.
Streamline and secure file upload handling in ASP.NET Core (.NET 8+) minimal APIs. This skill guides developers through parameter binding with IFormFile and IFormFileCollection, configuring coordinated Kestrel and FormOptions request limits, handling .NET 8 anti-forgery requirements, validating MIME types and magic byte signatures, preventing path traversal vulnerabilities, and streaming massive files with MultipartReader to eliminate memory buffering.
Key Features
01Dual request size configuration across Kestrel and FormOptions pipelines
02Memory-efficient large file streaming using MultipartReader
03Anti-forgery validation handling and endpoint bypass configuration
04Magic byte signature inspection and path traversal protection
05Automatic and metadata-bound IFormFile and IFormFileCollection parameter binding
060 GitHub stars
Use Cases
01Preventing malicious file uploads via magic byte checks and safe filename generation
02Streaming large video or archive files without memory exhaustion
03Building image and document upload endpoints in .NET 8+ REST APIs