SummaryNext JS Version : 13.4.7 Describe The Bug--------------------------------------------So i already read this discussion/Issue I didnt use any Next.JS API I think? I just used Server Actions to handle the communication through Other Apps API. I have alrady tried to put below code everywhere, in next js config, in the file (top,bottom, everywhere) and it keep saying 1mb file limit whenever i want to upload image more than 1mb. It works if the image is less than 1mb. How to Reproduce--------------------------------------------
Systems InformationServer : P.S. : This is my thesis project with my friend, I am actually a backend guy so i didn't really know much about the HTML and stuff, so i will tag my frontend guy @hfpland Additional informationNo response Example |
Replies: 8 comments 14 replies
|
See https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions#size-limitation |
|
that link is no longer available. what did yall do to increase size |
|
I don't think the accepted answer is valid anymore. Any updates? |
|
I want to be able to do something like this but in the build I see this warning any ideas to maybe bypass this |
|
Have a look at this documentation please. Depending on the Next.js version you are using this should work. You could also check if there is a restriction on the body size on a different level, for example on the hosting provider's side. |
|
guys an api call /api/.... is not a server action, look after what server action is and then setting body size will work out. |
|
If Server Actions body limits keep getting in the way, moving binary upload handling to a dedicated API route is probably the cleaner boundary anyway. That also gives you a natural place to inspect the upload before storage instead of treating the raw file as trusted just because the request succeeded. I built an OSS package for that Node.js step: It’s basically an inspect-before-storage layer for untrusted uploads, which tends to fit better in an API/upload route than inside the rest of the form action flow. |
|
I wrote an article explaining the pattern your app will most likely have once you need to upload assets that are bigger than the 1Mb default body limit on server actions: https://medium.com/@venancio.andre/stop-sending-user-uploads-through-your-server-45df3d9a9b0e I'm working on a image tool and at some point I went down this rabbit hole and decided to build an SDK so I dont have to deal with this in any other future project I have. |



See
https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions#size-limitation