如何删除Cloudinary上的zip文件?

时间:2015-01-07 11:44:23

标签: c# powershell cloudinary

我的代码通过调用

创建一个zip文件
Cloudinary.Multi()

现在我要删除cloudinary上的images.zip。

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?

我在PowerShell中使用Cloudinary .Net。 C#或任何语法的答案都是o.k

如何删除zip?

1 个答案:

答案 0 :(得分:0)

根据Cloudinary支持的回复,

  

为了删除多API生成的ZIP文件,您应该这样做   设置其公共ID,例如,发件箱,zip(记住逗号),并设置   在删除API调用时键入到多个。


我能够开发出一种工作解决方案,

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);


PowerShell版本是,

$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)