What problem does it solve? Handling file uploads safely is error-prone: trusting client-provided file types lets malware through, missing size limits cause denial of service, and unsanitized filenames enable path traversal attacks. This Skill provides battle-tested guidance for building secure, performant upload pipelines. ## Core Features & Use Cases - Security-First Validation: Verify actual file types via magic bytes instead of trusting extensions or Content-Type headers, and sanitize filenames to prevent path traversal. - Cloud Storage Patterns: Covers S3 and Cloudflare R2 workflows including presigned URLs with short expiry, cache-control headers, and multipart uploads for large files. - Resource Protection: Enforce upload size limits with Multer or Formidable, stream large files instead of buffering, and avoid memory exhaustion. - Use Case: When building a profile photo upload feature, use this Skill to validate images with the file-type library, generate safe UUID-based filenames, and issue short-lived presigned URLs so clients upload directly to R2 without proxying through your server. ## Quick Start Ask the AI to implement a secure image upload endpoint using presigned URLs with magic-byte validation and a 10MB size limit.