affanshahid / multer-storage-cloudinary

A Cloudinary multer storage engine
MIT License
104 stars 18 forks source link

Remove images #6

Closed jonathanmorales990 closed 4 years ago

jonathanmorales990 commented 6 years ago

How to remove a image?

hameeddamee commented 5 years ago

I'm also having this issue. I'd like to know how we can replace an existing image with the new upload using public_id. I tried using the callback in cloudinary storage but failed

zuber1077 commented 5 years ago

you can use normal cloudinary.v2.uploader.destroy(public_id); you need cloudinary package to do that const = cloudinary = require("cloudinary")

affanshahid commented 4 years ago

The storage engine removes file in case of errors autmatically. If you want to manually remove files as needed use the suggestion by @zuber1077