Issue with CORS while uploading images to Cloudinary from React application

I’m encountering a CORS-related issue while trying to upload images to Cloudinary from my React application running on http://localhost:5173. I have configured CORS on Cloudinary, included the necessary headers in my fetch request, and checked my Cloudinary account settings. However, I’m still facing the following error: Access to fetch at ‘https://api.cloudinary.com/v1_1/<cloud_name>/image/upload&#8217; from origin ‘http://localhost:5173&#8217; has… Read More Issue with CORS while uploading images to Cloudinary from React application

Get public id of an image to delete

I upload images to cloudinary using upload method: public function store(StoreProductRequest $request) { $name = cloudinary()->upload($request->file(‘image’)->getRealPath())->getSecurePath(); Product::create([ … "imageUrl" => $name, ]); } This will save the image cloudinary url in imageUrl field, in update method, i want to get the public id of the image of the product being updated if present: public function… Read More Get public id of an image to delete

How to properly display Cloudinary attachment in new tab?

My React app displays list of documents and images the right way using Cloudinary link. This is how I do it: {attachmentList.map((val, key) => { return ( <tbody key = {key}> <tr style={{backgroundColor:’#e7ecf0′}}> <td> <Link to={val.project_attachment_url} target="_blank" rel="noopener noreferrer" > {val.project_attachment_url} </Link> </td> </tr> </tbody> ) })} However, when I click on the link, it… Read More How to properly display Cloudinary attachment in new tab?

How to upload pictures cloudinary?

I write code simple code for upload images cloudinary. But somewhere have errors. import axios from ‘axios’ const uploadPic = async (media) => { try { const form = new FormData(); form.append(‘file’, media); form.append(‘upload_presets’, ‘social_media’); form.append(‘cloud_name’, ‘tmcotem’); const res = await axios.post(process.env.CLOUDINARY_URL, form) return res.data.url; } catch (error) { console.log(error); } } export default uploadPic;… Read More How to upload pictures cloudinary?