Image not getting deleted
kgoyal
Member Posts: 1 ✭
I am trying to delete an image. It says that the image is not found but it still opens on the cloudinary_url.
>>> cloudinary.uploader.destroy("user_cls1hjqjd00004enqgohyclng_profile_image") {'result': 'not found'} >>> cloudinary.utils.cloudinary_url("user_cls1hjqjd00004enqgohyclng_profile_image") ('https://res.cloudinary.com/dqpdbfczw/image/upload/user_cls1hjqjd00004enqgohyclng_profile_image', {})
Tagged:
0
Answers
-
Hi @kgoyal,
The
cloudinary.utils.cloudinary_url
is just an URL builder so it doesn't mean that while it generates a URL, the URL will actually resolved. In your case, the URL throws a 404 because effectively your asset is already deleted and doesn't exist in Cloudinary anymore.Instead of using the method you share, you can:
- Use the Admin API to see if the resource exists
- Look directly in your Cloudinary Media Library
Hope that helps.
Best,
Loic
0