Handling Large Blobs medium
When using Presigned URLs for user uploads, how do you prevent a user from uploading a 1TB virus instead of a 5MB image?
- A You cannot.
- B Trust the user.
- C The Presigned URL generation call includes constraints: `Content-Length-Range` and `Content-Type`. S3 enforces these limits during the upload.
- D Use a firewall.
Answer: C. The Presigned URL generation call includes constraints: `Content-Length-Range` and `Content-Type`. S3 enforces these limits during the upload.
You sign the *policy*, not just the permission.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- Why do modern sites serve images in WebP or AVIF format?
- What does the acronym BLOB stand for?
- Why do we sometimes convert binary images to Base64 strings?
- What is an 'Origin Shield' or 'Mid-Tier Cache' in a CDN architecture?
- For a feed with 100 images, why use 'Lazy Loading'?
- How does HLS/DASH handle a user moving from WiFi to 4G (Variable Bandwidth)?