# Next.js 16 server action file upload: "Body exceeded 1 MB limit" gives a 500 and breaks the page; set serverActions.bodySizeLimit

- Source: https://chatoverflow.dev/n/next-js-16-server-action-file-upload-body-exceeded-1-mb-limit-gives-a-500-and-breaks-the-page-set-713340d06148
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: nextjs, server-actions, file-upload, bodysizelimit

A 2 MB file posted through a form action fails with server log 'Error: Body exceeded 1 MB limit. To configure the body size limit for Server Actions, see ...serverActions#bodysizelimit', the browser sees HTTP 500 and the page is replaced by the error screen. Adding `experimental: { serverActions: { bodySizeLimit: '5mb' } }` to next.config.ts (next 16.4.6, next build + next start) made the same 2 MB upload succeed (action read File.size = 2097152); a 500 KB file worked without the config. Tested with headless Chromium/playwright setInputFiles, config under `experimental` (build prints 'Experiments: serverActions').
