There are few ways to raw resources via the UI and API.
Via API
Via UI
Via API
API calls are set to the 'image' resource type by default. In order to perform API calls for 'raw' resources, you should also set the resource_type to raw in the destroy API call.
Delete single raw resource by public id
Upload API destroy call example in Ruby:
Cloudinary::Uploader.destroy('my_file.txt', :resource_type => "raw")
Note: This feature does support invalidations by default
Delete multiple raw resources by public id
Admin API delete resources call example in Ruby:
Cloudinary::Api.delete_resources(['my_file.txt', 'my_file2.docx'], :resources_type => "raw")
Note: This feature does not support invalidations by default
Via UI
Delete raw resources individually
- Click on the Media Library tab
- In the search bar, select the drop-drop in the left-hand corner labelled "All" and select "Others (Raw)
- Find the asset and click on the overflow icon (the three dots) and select Delete
Bulk delete raw
- Click on the gear icon in the top right-hand corner which will take you to a new view
- In the right-hand panel, there is a heading called "Support Activities" and under it, there should be a link labeled Bulk delete.
- Select "Originals and derived resources"
- Under Search by, go to the last section and select "Resource type" to "Raw" and "Type" to either "Uploaded", "Private" or "Authenticated"
Comments
6 comments
Suppose i want to delete this file
res.cloudinary.com/dekmtxrqb/raw/upload/setixbbu9i03qnrczmbf.txt
then what should be the exact payload for this ?
\Cloudinary\Uploader::destroy('setixbbu9i03qnrczmbf.txt', array("resource_type" => "raw"));
am right?
Hi Rohit,
Thanks for reaching out.
Yes:) This is correct.
The default `resource_type` is `image` so when destroying `video` or `raw` files, you should set the appropriate `resource_type`.
How do I delete the resource which was created using a add-on ? like I have a used a add-on
Hi Aditya,
When using the Aspose Add-On, it generates a PDF which has the `resource_type:image` whereas the file uploaded has the `resource_type:raw`, hence you can run a deletion with those 2 types like this:
To delete the raw file in Python:
cloudinary.uploader.destroy('p5sxi8s04oiueembnt5k.xls', resource_type = 'raw')
To delete the PDF created via Aspose in Python:
cloudinary.uploader.destroy('p5sxi8s04oiueembnt5k.xls')
Best,
Loic
Thanks for the response,
I have to create a thumbnail for any resource uploaded on cloudinary(including "raw") is there a way to achieve it apart from using aspose ?
Hi Aditya,
Using Aspose is the only way to achieve the conversion from a `raw` file to a PDF with the `resource_type:image`. From there, you can then use transformations to generate the thumbnail.
You can find all the information on how to do it in this article.
Hope it helps.
Best,
Loic
Please sign in to leave a comment.