published fresh until

How do I upload files straight to S3 or R2 with progress in Next.js, and fix 413 and 403?

Summary When users upload large files from a Next.js app, send them directly to S3 or R2 to avoid the server body limit and provide progress, retry, and file checks. Serving private files with signed links has no tested answer yet.

Not for profile page with avatar, see case-profile-settings-form-validation-avatar-upload; records table, see case-expense-table-nextjs-supabase-filters-sort-csv-export

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The case

Users upload photos, PDFs or videos. Success looks like: the browser sends the file straight to object storage so your server's body limit is not hit, the upload shows progress and can be retried, a rejected upload gives a usable error, and only allowed files get in. Stack: Next.js with S3 or Cloudflare R2.

This is a map, not new advice: every row points to an existing WhatWorks thread. Nobody here ran this whole build; the Status column says what each linked thread rests on. "Tried" would need a linked trial report, and none of the linked threads has one yet.

Parts, in the order people do them

PartWhat to useStatusLink
Size errors (413)Send files direct to storage with presigned URLsDocumented: vendor or primary source, not tried, no linked trialFile uploads fail with 413: how do I send them straight to S3 or R2?
Forbidden on the upload (403)Presigned PUT checklist: signed headers, permissions, expiryDocumented: vendor or primary source, not tried (no linked trial)My S3 presigned PUT upload returns 403: what do I check?
Upload UI without your own backendHosted upload service button and drop zoneDocumented: vendor or primary source, not tried (no linked trial)How do I add file uploads to a Next.js app without building a backend?
Full uploader with progress and resumeDashboard-style uploaderDocumented: vendor or primary source, not tried (no linked trial)How do I add a full file uploader (progress, previews, resume)?
Drag-and-drop zone you style yourselfHook-based drop zoneDocumented: vendor or primary source, not tried (no linked trial)How do I build a drag-and-drop file upload zone with my agent?
Serve private files back with signed links and clean up orphansNo tested answer yetNo tested answer yetnone (see open request)

Where it breaks

Open questions

  • Parts marked "No tested answer yet" are gaps in WhatWorks; ask for them with the request tool so an editor can look: private download links for uploaded files and removing abandoned uploads.

Sources

Each linked WhatWorks thread cites its own primary sources; this page adds none of its own. Status labels were rechecked against the linked thread pages on 15 November 2026.

As of October 2026. a profile page with avatar upload, see case-profile-settings-form-validation-avatar-upload; a records table with export, see case-expense-table-nextjs-supabase-filters-sort-csv-export.

Started from a post by @WhatWorks editors, packaged by the editor.

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I upload files straight to S3 or R2 with progress in Next.js, and fix 413 and 403?
Summary: When users upload large files from a Next.js app, send them directly to S3 or R2 to avoid the server body limit and provide progress, retry, and file checks. Serving private files with signed links has no tested answer yet.
Copy for agent
get the whatworks thread case-file-upload-direct-to-s3-r2-progress-413-403-nextjs and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread case-file-upload-direct-to-s3-r2-progress-413-403-nextjs
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks