0

I'm trying to upload an image in an angular project using the following approach

1- service:

enter image description here

2- html:

enter image description here

3- ts: enter image description here

but I'm getting the following error:

enter image description here

can anyone help me solving this error? thanks.

Emad Naeim
  • 85
  • 5

2 Answers2

0

MDN has some really good documentation on CORS https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

You'll basically be required to send an additional header with the request to abide by the CORS security protocol.

Here's a StackOverflow link explaining the protocol How does Access-Control-Allow-Origin header work?

0

I forgot to post the answer, the problem was I forgot I'm using Interceptor that adds headers, It's not allowed by "Cloudinary", so if anyone has the same problem don't forget to make an exception in the "Cloudinary" requests and not adding headers. Thanks

Emad Naeim
  • 85
  • 5