Routing every file through your server does not scale. Presigned URLs offload the upload while keeping you in control.
When users send photos or documents, routing every file through the API saturates server bandwidth and memory. Object storage answers this, provided access is properly framed.
Delegate the upload without losing control
The server issues a short-lived presigned URL. The client sends the file straight to storage (Cloudflare R2, S3), never seeing the keys. The server validates the expected type and size upfront.
On read, same logic: presigned URLs for private content, controlled public access for the rest. Keys stay on the server.
Optimise on the way in
A raw phone image weighs several megabytes. A pass through Sharp (resize, recompress, modern formats) cuts weight and delivery costs. Along the way, strip EXIF metadata, which often exposes geolocation.
A good upload is invisible: fast, safe, and light downstream.