I'm currently building an ASP.NET Core 5 MVC for my course. I'm using Cloudinary for storing files in the cloud so I can get bonus points, but I have a problem with deleting files from it. In the documentation is written that I should use DeletionParams class and pass the publicId which I'm storing in the database, but whatever I do the DeletionParams class is returning me "not found".
public void DeleteFile(string publicId)
{
var deletionParams = new DeletionParams(publicId)
{
ResourceType = ResourceType.Raw
};
var results = cloudinary.Destroy(deletionParams);
;
}
And this is what parameters I pass to it
And this is the result from cloudinary
If more information is needed just ask in the comment section.
I found what was the problem. When you want to delete an image you should provide folder and publidId and also ResourceType = ResourceType.Image. If you want to delete a video it's the same way the only thing you should change is ResourceType to ResourceType.Video. For any kinds of other files you should provide full path plus public id and also the file extension and ResoureType should be ResourceType.Raw