2015-01-07 82 views
0

我的代碼通過調用創建一個zip文件,如何刪除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? 

我正在使用Cloudinary.Net與PowerShell。在C#或任何語法的答案將是o.k

如何刪除zip?

回答

0

基於從Cloudinary支持回覆,

爲了刪除由多API生成的ZIP文件,你應該 設置公共ID,例如,發件箱,郵政編碼(別忘了逗號),和在刪除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) 
相關問題