Image upload from local host end up in CORS policy error

I’m 99% positive CF Images doesn’t support cors. I post on the backend, which is probably ultimately better security wise, api keys and all. You could possibly try using a worker? Maybe that would do the trick.

This topic was automatically closed after 15 days. New replies are no longer allowed.

I’m 99% positive CF Images doesn’t support cors. I post on the backend, which is probably ultimately better security wise, api keys and all. You could possibly try using a worker? Maybe that would do the trick.

it does support CORS, but obviously not for API requests as what I see in the pictures. More over this is incorrect use of direct upload feature, since you’re exposing API secret key to the client.

Instead, you should generate direct upload link with API on a backend and provide this url to a client to be able to upload an image.

NB: currently you’d need to check later if the image was indeed uploaded by the user, but this is something we are planning to work on to provide upload webhooks.

1 Like