peternovak
peternovak15mo ago

How to set sizeLimit > 1MB (to solve 413 error)?

Hi all, I am trying out the T3 stack where I want to send area polygons given by the user to my NextJs backend using TRPC. It worked well for smaller polygons drawn by hand, but one I allowed my users to upload files over 1MB I run into the problem of '413 (Body exceeded 1mb limit)' I found in the NextJs documentation: https://nextjs.org/docs/pages/building-your-application/routing/api-routes#custom-config that the setting to enable this is to reconfigure this limit to something like: sizeLimit: '4mb', In a suitable place. I have tried to add this configuration into various places of my trpc.ts but so far without success. Does anyone have any advice of how to reconfigure this limit properly? Greateful for all advises!
Routing: API Routes
Next.js supports API Routes, which allow you to build your API without leaving your Next.js app. Learn how it works here.
No description
0 Replies
No replies yetBe the first to reply to this messageJoin