minimal-api-file-upload
File upload endpoints in ASP.NET minimal APIs (.NET 8+)
npx skills add dotnet/skills --skill minimal-api-file-upload --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Implementing File Uploads in ASP.NET Core Minimal APIs ## When to Use - File upload endpoints in ASP.NET Core minimal APIs (.NET 8+) - Handling IFormFile or IFormFileCollection parameters - When you need size limits, content type validation, or streaming large files ## When Not to Use - MVC controllers → `[FromForm] IFormFile` works directly with attributes - Simple JSON body → no file upload needed - Very large files (> 1GB) → use streaming with `MultipartReader` instead ## Inputs | Input | Required | Description | |-------|----------|-------------| | File parameter(s) | Yes | IFormFile or IFormFileCollection | | Size limits | Yes | Max file/request size | | Allowed types | No | Content type or extension restrictions | ## Workflow ### Step 1: CRITICAL — Understand IFormFile Binding in Minimal APIs ```csharp // In .NET 8+ minimal APIs, IFormFile binds automatically from multipart/form-data // when it is the only complex parameter. app.MapPost("/upload", (IFormFile file) => ...); // CRITICAL: When you mix files with other form fields, use [FromForm] on all // form-bound parameters (or group them into a single [FromForm] DTO). app.MapPost("/upload-with-metadata", ([FromForm] IFormF
- When to Use
- When Not to Use
- Inputs
- Workflow
- Step 1: CRITICAL — Understand IFormFile Binding in Minimal APIs
- Step 2: CRITICAL — File Size Limits Are Separate from Request Size Limits
- Step 3: CRITICAL — Anti-Forgery Auto-Validates Form Uploads in .NET 8+
- Step 4: CRITICAL — Validate File Content, Not Just Extension
- Step 5: CRITICAL — Streaming Large Files Without Buffering
- Common Mistakes
What does the minimal-api-file-upload skill do?
File upload endpoints in ASP.NET minimal APIs (.NET 8+)
How do I install it?
Run `npx skills add dotnet/skills --skill minimal-api-file-upload --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
