# File Uploads And Storage

> Design secure, scalable file upload and storage flows (direct-to-cloud, validation, access control, lifecycle). Use when implementing uploads, downloads, media handling, or object storage integration.

- Skill: `itsual/file-uploads-and-storage` (Agent Skill)
- Install (CLI): `npx skillmds@latest add itsual/file-uploads-and-storage`
- Raw SKILL.md: https://api.skillmd.com/api/skills/itsual/file-uploads-and-storage/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: itsual (https://skillmd.com/u/itsual)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/itsual/file-uploads-and-storage

---


# File Uploads and Storage

## Overview

File handling involves security, performance, cost, and user experience trade-offs. Prefer direct-to-storage patterns for larger files.

## When to Use

- Implementing file or image uploads
- Integrating with S3/GCS/Azure Blob or similar
- Reviewing security of existing upload flows

## Key Practices

- Validate file type, size, and content where appropriate
- Prefer pre-signed URLs / direct uploads for large files
- Store metadata in your database; store blobs in object storage
- Apply least-privilege access controls and short-lived credentials
- Plan for virus scanning, image processing, or async pipelines if needed
- Define retention and deletion policies (including GDPR-style erasure)
- Use CDNs for frequently accessed public assets

## Security Checklist

- [ ] Content-type and size limits enforced
- [ ] Files are not executable in dangerous contexts
- [ ] Access is authorized on every download/view
- [ ] Secrets are not required in the browser for private files

## Verification

- Upload and download paths are secure and performant
- Orphaned files and storage costs are manageable
- Deletion/retention works as specified

