Direct creator upload CORS error on upload

The startup I’m working for is trying to switch to Cloudflare Stream but I’m having troubles with the direct creatror uploads

When a user is trying to upload via our web form they’re getting the following error:

Access to XMLHttpRequest at '[..]3abe8c0' from origin 'https://my-website' has been blocked by CORS policy: Request header field cache-control is not allowed by Access-Control-Allow-Headers in preflight response.

I have not set any allowedOrigins for the video so upload should work fine (it is via CURL). How can the user upload if not via my form?

Hi, please check this codepen example:

On line 16, you can replace the hardcoded url with your tokenized URL and then do an upload. If it works (it worked for me), feel free to adapt it for your use case.

okay thanks I’ll try it. For now I have worked around the problem by first letting users upload to my S3 bucket and giving cloudflare the signed url for downloading the video form S3

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.