Railway issue uploading files

javikeziahPRO

a year ago

I am making a SvelteKit app with a backend that allows users to upload imgs for their avatar saving them in Cloudinary.

When I've tested on Railway, I've realized that the imgs bigger than 1MB didn't get uploaded. I thought it was a Railway issue because in development they were uploaded, and I saw online that more people had the same problem in other forums.

The Railway team told me that was probably for another reason, so I've created the same repo in Vercel, and in Railway, and in Vercel works fine, but in Railway it doesn't.

The only difference between both projects it is the node adapter in Railway.

The error I'm receiving in a 413: (Payload Too Large)

I've also deployed the example with a Cloudinary account so you don't have to: https://test-upload-rw-sk-production.up.railway.app/

Railway repo: https://github.com/JaviKeziah/test-upload-rw-sk

3 Replies

a year ago

I think the difference is because of the adapter. Have you tried setting the BODYSIZELIMIT?


javikeziahPRO

a year ago

You are right! I didn't know that. Now it works great. Thank you very much, Faraz.


a year ago

Awesome, happy to help! ^ _ ^