0

I am getting a return error when I upload images to cloudinary and save the links to mongodb Atlas. When I send 2 or 3 images everything works.

when I send more than 20 images, everything registers on cloudi and mongo and I receive an error.

Could someone help me? I think there must be a connection with time. Strangely everything saves except that I have an error.

Thank you

my code

my error

Akber Iqbal
  • 14,487
  • 12
  • 48
  • 70

1 Answers1

0

CORS issue that you encountered is actually the result that the server has imposed where (domain) the client browser could fetch, hence Cross-Origin Resource Sharing. In order to mitigate this issue, a response header coming from the server should set the following header:

Access-Control-Allow-Origin: https://res.cloudinary.com/

The above header should tell the client browser that it is allowed to fetch resources from the Cloudinary domain. There are many CORS articles online and one I can recommend is from Mozilla at: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

  • Thank you Aksay Joshhi My problem comes from Heroku, I have exactly this problem: https://stackoverflow.com/questions/69497229/how-to-have-more-then-30sec-response-timeout-in-heroku I put console.log in my backend and indeed after 30s it sends an error but my server continues to work. – nicolas caux Mar 18 '22 at 16:36