<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1063935717132479&amp;ev=PageView&amp;noscript=1 https://www.facebook.com/tr?id=1063935717132479&amp;ev=PageView&amp;noscript=1 "> S3 - Signed URLs

S3 - Signed URLs

A signed URL is a temporary, scoped link to a single object. It lets a client read or upload one file directly to storage, without making the bucket public and without sharing your credentials. It's a time-limited guest pass. It opens one specific door, and only until it expires.

Browser Your server Bucket private 1 ask for a link 2 signed URL · 5 min 3 download one file directly (never touches your server)
Your server signs a short-lived link; the browser uses it to reach one file directly, while the bucket stays private.

How to use it

import { getSignedUrl } from "@aws-sdk/s3-request-presigner";

// A link the browser can use to download one private file for 5 minutes
const url = await getSignedUrl(
  s3,
  new GetObjectCommand({ Bucket: "my-app-uploads", Key: "invoices/123.pdf" }),
  { expiresIn: 60 * 5 }
);

The same trick works for uploads with a PutObjectCommand. The browser uploads straight to the bucket, so the file never has to pass through your server.

Why it matters

  • Your bucket stays private; only holders of a valid link get in
  • Large uploads and downloads skip your server, saving bandwidth and memory
  • Access expires on its own. No cleanup, no lingering public links

Check your understanding

Question 1 of 4

What does a signed URL actually grant?

Your server hands a client a signed URL for `invoices/123.pdf` that expires in 5 minutes. What access does that link give?