Next.js Discord

Discord Forum

413 Request Entity Too large while uploading file via formdata

Unanswered
Chilean jack mackerel posted this in #help-forum
Open in Discord
Chilean jack mackerelOP
Like in title I have an API which is used to upload files via FormData to the server. I have my NextJS website running on my VPS and I want to increase bodyparser limit so I can fix this issue. The problem is that with app directory the default way to increase this limit is deprecated. Anyone tried to solve this?

5 Replies

Stony gall
same case also cannot find a way to set limits like maximum file size..
@Stony gall same case also cannot find a way to set limits like maximum file size..
Chilean jack mackerelOP
are you using some sort of vps
with nginx for example
Stony gall
still in development, but yeah planning to use vps , i know how to set limits by configuring nginx but i don't want to send an nginx error page to users
afaik, no limmiter in Next.js itself. indeed i can upload super large file(53MB) to a Next.js running locally on my mac. in case of hosted in Vercel platform, the cap is 4.5MB
https://vercel.com/docs/concepts/limits/overview#serverless-function-payload-size-limit

meaning the cap is implemented in platform, so the 413 could come from your hosting platform vender.