Next.js · sdk · fg-0301

File upload through a Server Action fails with 'Body exceeded 1 MB limit'

If you see Error: Body exceeded 1 MB limit, the cause and the fix for Next.js are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Error: Body exceeded 1 MB limit.Uploads of small images work and larger ones fail with a 413 or an unhandled action error
Cause
Server Actions cap the request body at 1 MB by default to limit parsing cost and abuse. FormData with a file counts toward that cap.
Fix
Raise serverActions.bodySizeLimit to what you actually need, or upload large files straight to object storage with a presigned URL and send only the key to the action.
Apply
// next.config.ts export default { experimental: { serverActions: { bodySizeLimit: '10mb' } }, }
Affected
Next.js 14 to 16.4, App Router Server Actions
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun