413 (Payload Too Large) when upload is made on Heroku platform

94 views Asked by At

I've made migration once according to official tutorials with Direct-to-S3 approach.

The problem is that when I upload a model (200 MB) in localhost, there's no problem and the files are uploaded. If I want to upload it on the deployed platform, it's giving me 413 (Payload Too Large) error. I tested a smaller size file upload just to be sure if it's really about file size and the upload was successful.

For upload URL endpoint:

buckets/${bucketKey}/objects/${encodeURIComponent(objectKey)}/signeds3upload?parts=${parts}&firstPart=${firstPart}

I've added &useCdn=true but I still receive 413 error. At the same time I've upgraded the Heroku performance by changing dynos but this didn't help as well. I'm using Cloudflare, Heroku and Node.js.

What can be done to increase file size on uploads?

1

There are 1 answers

5
Petr Broz On

It sounds like this could be a limitation on the Heroku side. When uploading the 200MB file, are you generating just a single upload URL for uploading the entire file? If so, consider splitting the data into multiple smaller chunks, and upload those separately.