Can i send BLOB to CLOUDFLARE IMAGES?

Hi Guys… im trying to send a BLOB to CLOUDFLARE IMAGES… with no success :frowning:

I need convert my BLOB to FILE first to send for Cloudflare?

Thanks

What error are you seeing?

Sven… Thanks for reply… The first thing i cant find in documentation about CORS. Can you help where i can set free to send my tests from my LOCALHOST?

Access to fetch at ‘https://api.cloudflare.com/client/v4/accounts/c4d72b648772f2b69f84f92a48568a34/images/v1’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: 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.
index.ts:21 POST https://api.cloudflare.com/client/v4/accounts/c4d72b648772f2b69f84f92a48568a34/images/v1 net::ERR_FAILED

TypeError: Failed to execute ‘append’ on ‘FormData’: parameter 2 is not of type ‘Blob’.
at useCloudflare (index.ts:12)
at handleSubmit (index.tsx:26)
at onClick (index.tsx:64)
at HTMLUnknownElement.callCallback2 (react-dom.development.js:3945)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
at invokeGuardedCallback (react-dom.development.js:4056)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4070)
at executeDispatch (react-dom.development.js:8243)
at processDispatchQueueItemsInOrder (react-dom.development.js:8275)
at processDispatchQueue (react-dom.development.js:8288)

This API shouldn’t be used in a browser as it exposes your Cloudflare API key or token to visitors. Have you tried to run it server-side?

2 Likes

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