0

I am working on a project which has an upload file feature. The text data from this file is to be send to the backend Node js server through axios post request and then uploaded to the database. While using a smaller file (around 4 kb), it is working fine. But when I upload a large sized file (~10000 kb), I am getting two error simultaneously. CORS error at the client side (React Js). PayloadTooLargeError at the server side (Node Js).

enter image description here

enter image description here

I tried using the soluyion given in the post: Error: request entity too large, but it is not working.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
  • This issue is not from the frontend side backend has to change the API payload limit of max size of your file – Meet Majevadiya Jun 29 '22 at 15:15
  • Can you please elaborate this? I did tried changing the limit at the backend using commands app.use(express.json({limit: '50mb'})); and app.use(express.urlencoded({limit: '50mb'})); but its not working. Still getting the same issues. Is there any other way to increase the payload limit – Saksham Arya Jun 29 '22 at 22:23

0 Answers0