'Can we update uploaded image on cloudinary?

I'm new to use cloudinary service. Uploaded image successfully on cloudinary and get public URL. But I want to update existing image with new one is there any option on cloudinary to update existing image? Please suggest me in this. Thanks in advance :)



Solution 1:[1]

Yes, it's possible to update an asset already uploaded into Cloudinary.

To do that, you would need to perform an upload() method call and supply the new asset you want to upload (in the file parameter) and also set the public_id parameter to the existing public_id you want to overwrite. The overwrite parameter as part of the upload() method already defaults to True and that will be all that's needed to replace the old asset in your account with the new one. You should also consider passing the invalidate parameter set to True to tell Cloudinary to purge the CDN cache for the old asset so that existing URLs return the new asset after the update.

Apart from the API, you can overwrite the image via Media Library UI upload as well. To do that you would need to go to your Media Library and use the Upload button to launch the Upload Widget. There you will see an 'Advanced' option at the bottom that will allow you to specify a public_id which you would set to the public_id you want to overwrite and then just drag and drop or select the asset you want to upload. You will get a prompt to confirm the overwrite action before the upload completes.

Solution 2:[2]

Click on upload and then click on advanced settings. Then enter public id same as image you want to replace. This will update the image with new version id. Screenshot of uploading with advanced settings

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Aleksandar
Solution 2 Varun