CORS errror when uploading a file exceeding the limit
See original GitHub issueHello and thank you for your great work on this library.
I use it
- with express-graphql on the server
- with vuejs on the client (with graphql-upload-client).
Everything works fine except one thing:
- if we try to upload a file exceeding the limit defined by
maxFileSize
the error message onlocalhost
is correct:File truncated as it exceeds the 3000000 byte size limit.
. But when I do the same on a remote VPS, the error is
POST https://api.my-app.tld/ 413
Access to XMLHttpRequest at 'https://api.my-app.tld/' from origin 'https://my-app.tld' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I tried to set the CORS Access-Control-Allow-Origin
on the server to different values (including ‘*’), with no success.
Why is this error message different from localhost
?
How to control this error message?
Thank you
The repos are here:
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
CORS error when uploading larger files - Stack Overflow
Make sure your Max allowed content Length in your web.config is set high enough otherwise you'll get an error. Check your IIS logs...
Read more >CORS error only for uploading files bigger than around 2 MB
They often have limits set on the file size that can be uploaded - quick search shows Nginx defaults to 1 MB max,...
Read more >Upload files in ASP.NET Core - Microsoft Learn
Set a maximum size limit to prevent large uploads. ... The following error indicates that the uploaded file exceeds the server's configured ......
Read more >Cors error when uploading file - Laracasts
Hello, i'm facing again the cors error when i'm trying to upload file with axios my cors.php: [], 'allowed_methods' => ['*'], 'allowed_origins' ...
Read more >Troubleshooting a failed canary - Amazon CloudWatch
Canary Failed. Error: No datapoint - Canary Shows timeout error Trying to access an internal endpointCross-origin request sharing (CORS) issue ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok. I finally found the source of the problem:
On the production server , we use this nginx proxy: https://github.com/jwilder/nginx-proxy, which has a 2Mb default upload limit. We changed by setting the
client_max_body_size
.Thanks for your help
Aaah, that makes sense. Glad you figured it out!