Skip to main content

How to delete raw assets?

Comments

6 comments

  • Rohit Kumar

    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?

    0
  • Maor Gariv

    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`.

    0
  • aditya

    How do I delete the resource which was created using a add-on ? like I have a used a add-on

    "aspose" to create a pdf on upload of a raw resource type. When I delete the raw resource type the pdf one resource should also get deleted. How do I achieve that ?
    0
  • Loic Verger Del Bove

    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

    0
  • aditya

    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 ?

    0
  • Loic Verger Del Bove

    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

    0

Please sign in to leave a comment.