Next.js Discord

Discord Forum

Avoiding 413 Error of filesize exceeds 4.5mb by uploading directly to S3

Answered
Keyhole wasp posted this in #help-forum
Open in Discord
Keyhole waspOP
I was looking at this post on vercel: https://vercel.com/guides/how-to-bypass-vercel-body-size-limit-serverless-functions#upload-directly-to-the-source
It goes over how to upload a file bigger than 4.5mb to vercel/blob. It does note that its possible to do it for S3. I am looking for some knowledge on how exactly to do this when submitting data as multipart-form-data and then directly uploading it to S3. Would appreciate some guidance on this.
Answered by joulev
the keyword is "presigned url"

you generate a presigned url, then you send the file directly to s3 via that url instead of sending through the nextjs server
View full answer

3 Replies