# File Uploads and Object Storage

> Upload resumes and images safely using object storage, signed URLs, validation and image processing. Free notes, key concepts, resources and a mini project.

Canonical: https://www.internhack.in/roadmaps/tracks/full-stack/file-uploads
Last updated: 2026-11-28

Upload resumes and images safely using object storage, signed URLs, validation and image processing.

Advanced · about 4 hours · difficulty 3/5

Learn first: [Authorization and Access Control](https://www.internhack.in/roadmaps/tracks/full-stack/authorization-rbac), [Environments, Config and Secrets](https://www.internhack.in/roadmaps/tracks/full-stack/environment-and-config)

Resumes, profile photos and offer letters should not live on your server's disk or in your database. They belong in **object storage** such as Amazon S3, Cloudflare R2, Supabase Storage or Cloudinary for images.

### The signed upload pattern

1. The client asks your API for permission to upload, with file name, type and size.
2. Your server checks auth and validation, then returns a short-lived **pre-signed URL**.
3. The browser uploads directly to storage, bypassing your server.
4. The client confirms, and you save the file key (not a public URL) in PostgreSQL.

### Safety

- Validate type and size on the server, not just in the browser input.
- Keep private files (resumes) in private buckets and serve them through signed download URLs that expire.
- Generate your own random keys; never trust the user's file name.
- Scan or process images server-side (resize, strip metadata) when needed.

### Pitfalls

- Public buckets containing personal documents.
- Uploading through serverless functions that hit body size limits.
- Storing files as base64 blobs in the database.

You are ready to move on when students can upload a PDF resume through a signed URL to a private bucket, and only the student and authorised recruiters can download it.

## Key concepts

- **Object storage basics**
- **Pre-signed upload URLs**
- **Private files and signed downloads**
- **Type and size validation**
- **Image resizing and CDNs**
- **Cloudinary or Supabase Storage**

## Mini project

Add resume upload to your portal using pre-signed URLs to a private S3-compatible bucket (Cloudflare R2 or Supabase Storage), with server-side validation and expiring download links for recruiters.

## Check yourself

Why upload directly from the browser to storage using a signed URL instead of streaming the file through your API?

## Free resources

- [Amazon S3 User Guide](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) (AWS)
- [Cloudflare R2](https://developers.cloudflare.com/r2/) (Cloudflare)
- [OWASP File Upload Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html) (OWASP)

Previous: [Web Performance and Core Web Vitals](https://www.internhack.in/roadmaps/tracks/full-stack/web-performance) · Next: [Realtime Features with WebSockets](https://www.internhack.in/roadmaps/tracks/full-stack/realtime)

## More in Beyond CRUD: Real-World Features

- [File Uploads and Object Storage](https://www.internhack.in/roadmaps/tracks/full-stack/file-uploads)
- [Realtime Features with WebSockets](https://www.internhack.in/roadmaps/tracks/full-stack/realtime)
- [Background Jobs, Queues and Scheduled Tasks](https://www.internhack.in/roadmaps/tracks/full-stack/background-jobs)
- [Payments with Razorpay](https://www.internhack.in/roadmaps/tracks/full-stack/payments-razorpay)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Full-Stack Developer Roadmap](https://www.internhack.in/roadmaps/tracks/full-stack)
