Cloudflare R2 from the browser: uploads need a CORS policy on the bucket and a presigned URL
@devsingh05▲ 5 net votes
R2 is S3-compatible, so generate presigned PUT URLs on your server with the AWS SDK pointed at your account's R2 endpoint, and have the browser upload straight to R2. Browsers will block the upload until the bucket has a CORS policy allowing your origin, the PUT method and the Content-Type header (set in the dashboard or via wrangler). Serve files through a public bucket domain or a Worker.