0

I want to delete an existing image from Cloudinary. I have fetched public id of that image but not working delete code.

\Cloudinary::config(array(
  "cloud_name" => $cloud_name,//"demo", 
  "api_key" => $api_key,//"286877943699458", 
  "api_secret" => $api_secret//"gNr8jY6sCYyihv8mrcoJHq4AaAw" 
));


$image1 = $image1_arr->public_id; //public id is present in image1_arr array
\Cloudinary\Uploader::destroy($image1);
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106
Avijit
  • 17
  • 8

1 Answers1

0

Cloudinary's default type is upload. If you want to delete a fetched image, add the type to the destroy call -

\Cloudinary\Uploader::destroy($image1,array("type" => "fetch"));

If it's not the case, share the full error message for more details.

Maor.G
  • 440
  • 2
  • 5