#4.5 MB payload bypass on serverless functions & cors

8 messages · Page 1 of 1 (latest)

cloud canyon
#

Hello I have a problem and I am trying to find a workaround. I am having a fileupload on my site which lets the user upload a file up to 10mb, however the serverless functions function of vercel only allow a payload size of max 4.5 mb which is exceeded by this time the user uploads a 10mb file.

I tried now to not use the /api/upload directory with the outgoing request to my server, instead use the request directly inside the app to upload the file directly to my server https://vercel.com/guides/how-to-bypass-vercel-body-size-limit-serverless-functions. However, this is running into big cors issues as the domain I am hosting it is not the same as the outgoing request (I assume)?

App hosted example: demo.upload.com
Outgoing request: api.upload.com

Both domains are different, therefore getting the cors error.

Does anybody know how to overcome this issue? I tried everything with setting access control headers to the request but nothing works out...

ivory kindleBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

hazy sky
cloud canyon
hazy sky
#

On the server's response headers

cloud canyon
hazy sky
cloud canyon