Cloudflare Images direct upload CORS error

Hi, I’m having same issue, ref: Cloudflare Images direct upload CORS problem

When I try the example code from the doc, I got the CORS error

Access to fetch at '' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

code snippet from the API doc

const form = new FormData();
form.append("expiry", "");
form.append("id", "");
form.append("metadata", "");
form.append("requireSignedURLs", "");

const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'multipart/form-data; boundary=---011000010111000001101001',
    Authorization: 'Bearer undefined'

options.body = form;

fetch('', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
1 Like

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