how can I delete empty folder?
Hello,
I am using delete_all_resources request and it deletes all images from folder I want, but not the folder. How can I delete folder too?
-
We have an API method for deleting empty folders, but it is not currently documented or supported in our SDKs. It is on our roadmap to support this. While no ETA for it yet, I'll gladly let you know once it's ready.
However, you can accomplish this by calling the API directly, for example:
curl -X DELETE -u <API_KEY>:<API_SECRET> "https://api.cloudinary.com/v1_1/<cloud_name>/folders/<folder>"
-
Hi Mohamad,
The resources will first need to be deleted.
This can be done using the delete_resources_by_prefix method is restricted to 1000 images per call. You can use the list by resource methods to list the resources under the folder and then delete by public id.
Another option would be to use the bulk delete UI in the media library settings: https://cloudinary.com/console/settings/bulk_delete/new
You can add the prefix as the folder name and also choose if you would like to delete the derivatives as well. -
Here is more information of how to delete an empty folder:
If you have further questions, please feel free opening a support ticket:
http://support.cloudinary.com/tickets/new
Please sign in to leave a comment.
Comments
7 comments