dotnet/skills
Minimal API File Upload
1 479e ex aequo sur 4 265 skills du métier Développement, par installations. Dans l'annuaire depuis le 18 novembre 2026.
Description
Couvre les pièges de l'envoi de fichiers dans les API minimales .NET 8+. Règles de liaison (quand IFormFile exige [FromForm]), les deux limites de taille distinctes (MaxRequestBodySize de Kestrel et FormOptions) et les points à vérifier.
Voir la description originale (anglais)
Covers the critical gotchas when handling file uploads in .NET 8+ minimal APIs. You get the binding rules (when IFormFile needs [FromForm], when it doesn't), the two separate size limits that will both bite you (Kestrel's MaxRequestBodySize and FormOptions.MultipartBodyLengthLimit), and the anti-forgery token validation that auto-applies to form endpoints unless you explicitly opt out. The security section is solid: validates magic bytes, not just extensions, and shows how to avoid path traversal attacks. If you're uploading files larger than a couple hundred MB, it walks through MultipartReader for streaming without buffering everything into memory first. This is the reference you want open when debugging why your 50MB upload returns a 400.
Installer le skill
- 1Copiez la commande d'installation (bouton Copier, en haut de la fiche).
- 2Lancez-la dans un terminal, sur la machine où vous utilisez Claude Code.
- 3Demandez la tâche à Claude comme d'habitude : il charge le skill quand la demande s'y prête.