How to replace an image in cloudinary and keep the same URL?

≯℡__Kan透↙ 提交于 2021-01-28 02:50:49

问题


I have an image in cloudinary that I would like to replace but keep the original URL. Would it be possible?


回答1:


Yes it is possible to update an image and keep the same URL.

When you upload the new image you want to make its public_id be the same as the existing image you're trying to replace. Then your Cloudinary account will be updated with the new image overriding the old one.

However note that if the original (older) image was already accessed, it might get cached in the CDN.

Here is a helpful article for further reading on how to update already existing images and how you can invalidate your resources on the CDN if need be:

https://support.cloudinary.com/hc/en-us/articles/202520852-How-can-I-update-an-already-uploaded-image-




回答2:


I'd comment, but I don't have the rep.

Things might have changed in the UI that make Marissa's answer slightly inaccurate (at least for doing it thr. When I attempted to create a new image with the same public ID, it didn't ask me to overwrite the old one, it just gave it the public ID I submitted and appended it with "-1".

In order to create a new image at the same URL as I had it previously, I had to delete the old image, log out and log back in to cloudinary, and then create a new image with the same public ID (the public ID option appears if you click on advanced at the bottom of the upload window).

Just remember you need to delete the version from the URL ( "/vXXXXXX" where X is a number).



来源:https://stackoverflow.com/questions/47969981/how-to-replace-an-image-in-cloudinary-and-keep-the-same-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!