0

My code creates a zip file by calling,

Cloudinary.Multi()

Now I've to delete images.zip on cloudinary.

Cloudinary.DeleteResourcesByTag() //don't work because images.zip has no tag to it.
Cloudinary.DeleteAllResources()  // Deletes all images. Zip files persist
Cloudinary.DeleteResources() //May work, what parameters should I pass to it?

I'm using Cloudinary .Net with PowerShell. An answer in C# or any syntax will be o.k

How can I delete the zip?

Abdullah Leghari
  • 2,332
  • 3
  • 24
  • 40

1 Answers1

0

Based on reply from Cloudinary support,

In order to delete a ZIP file generated by the multi API, you should set its public ID, e.g., outbox,zip (mind the comma), and also set the type to multi at the deletion API call.


I was able to develop a working solution as,

Cloudinary cloudinary = new Cloudinary(account);

List<string> IDlist = new List<string>();
list.Add("outbox,zip");

DelResParams delParams = new DelResParams();
delParams.PublicIds = IDlist;
delParams.Type = "multi";

cloudinary.DeleteResources(delParams);


And the PowerShell version is,

$list = New-Object -TypeName System.Collections.Generic.List[string]

$list.Add("outbox,zip")

$deleteParams = New-Object CloudinaryDotNet.Actions.DelResParams
$deleteParams.PublicIDs = $list
$deleteParams.Type = "multi"


$cloudinary.DeleteResources($deleteParams)
Abdullah Leghari
  • 2,332
  • 3
  • 24
  • 40