High-Performance S3 File Upload System
Large files going straight to Amazon S3 with multipart uploads and presigned URLs. More infrastructure work than a basic upload form.
- AWS S3
- Multipart Upload
- Presigned URLs
- Laravel
Problem
Users needed to upload large files without melting the app server or falling apart on bad networks.
Context
A production web app where uploads land in S3, with the backend coordinating the upload lifecycle and cleanup.
Challenge
Big files, chunk sizes, presigned URLs, flaky networks, retries, failed parts, cancelled uploads, and keeping file bytes off the application server.
Approach
I designed the flow so the browser talks to S3 directly with presigned URLs. The backend starts, tracks, completes, and aborts multipart uploads, and cleans up unfinished ones.
Result
A more resilient upload path that treats large files as an ops and reliability problem, not a one-shot HTTP request.
Lessons
Uploads usually break in production for boring operational reasons. Chunking, retries, cancellation, and cleanup matter as much as the happy path.
Architecture
- Amazon S3 multipart upload API
- Presigned URLs for direct client-to-S3 transfer
- Backend orchestration for initiate / complete / abort
- Retry and failed-part recovery logic
- Cleanup for incomplete multipart uploads
Technical details
- - Picking chunk sizes that balance speed and failure cost
- - Uploading parts in parallel where it helps
- - Retrying failed parts without restarting everything
- - Keeping the app server out of the byte path
- - Aborting incomplete uploads so storage doesn't quietly pile up