how to upload image in latest version cludinary from frontend using react with the help of api base url?
i am trying to upload image in cloudinary using this url https://api.cloudinary.com/v1_1/ashu123/image/upload" but unortunately i got error regarding cors policy...i am using old way to upload image in cloudinary..i would like to
know also about how to upload image in latest version in cloudinary from frontend in react
Access to fetch at 'https://api.cloudinary.com/v1_1/ashu123/image/upload' 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. please resolve this issue...
-
Hi Ashutosh,
You could upload from your front-end of your react app directly by calling the REST API (see https://cloudinary.com/documentation/upload_images#uploading_with_a_direct_call_to_the_rest_api). You can check the link for an example (i.e. using JavaScript in React): https://codesandbox.io/s/upload-demo-a-ne0u1?file=/src/CldUploaderForm.js
Hope this helps.0
Post is closed for comments.
Comments
1 comment