How to replace image in Web UI
Hi,
I'm new to Cloudinary and am struggling to find a way to replace an image via the Web UI.
Let's say I've uploaded image A with the name "example.jpg". Now I'd like to replace this file with a different image B but keep the public URL the same. The one way I've figured out how to do it is to rename the old image in the Web UI to "example_old.jpg" and then upload the new image as "example.jpg". After some time, when the CDN refreshed the entry, the new image will be served instead of the old one.
However, this seems like a cumbersome way to replace an image and I assume there is a much more straightforward way to do it. Also, with this, the image's version history is now broken as I didn't really replace the image. Instead of one version history, there are now two, one for "example_old.jpg" and one for "example.jpg".
Instead of having to explain to my colleagues how to replace an image following the confusing multi-step approach outlined above, it would be much better to tell them to click on some "replace image" button. Is there a better way to replace the image in the Web UI that doesn't require this process and that doesn't break the version history?
-
Official comment
Hey Ed. Thanks for your question.
By default we give uploads a name that is a random string of characters, but you can set uploads to use the original filename if you want/need. The best thing to do would be to set up an Upload Preset like so:
This will allow you to upload files with the same name as existing assets in your cloud, and they'll be overwritten. You can find your Upload Presets by pressing the settings icon and choosing upload, or by clicking this link.
You can also set this Upload Preset to be applied to uploads that take via the Media Library, the API, or both. Alternatively you can just target image/video/raw uploads.
In the example below, I've made an upload preset called keep_filename with the options above, and set it so that it is automatically applied to uploads done via the Media Library:
Regarding waiting for the CDN cache to clear, overwritten assets are given an updated version number, so you could use that in the URL to bypass any caching. You can read about versioning in this article.
I hope this helps answer your questions. If you have any further queries, please feel free to reply here or raise a ticket via our Support Portal.
Thanks,
-DComment actions
Please sign in to leave a comment.
Comments
1 comment