如何从 api 更改 cloudinary 中的图像名称

how can I change the name of an image in cloudinary from the api

例如我有这张图片:

http://res.cloudinary.com/xxxx/image/upload/v1520903853/tt/aa/ee/E14/name_2018-03-12_19_17_31.jpg

我需要重命名为:

myname.jpg

并移动到路线:

/tt/aa/

怎么办?我正在使用 javascript

要重命名图像,您可以使用我们的API。但是,因为它已签名(出于安全原因),您将需要使用 server-side 脚本。例如在 NodeJS 中:

cloudinary.v2.uploader.rename(from_public_id, to_public_id, 选项, 回调);

你的情况:

cloudinary.v2.uploader.rename("tt/aa/ee/E14/name_2018-03-12_19_17_31", "/tt/aa/myname", 选项, 回调);

请注意,为了绕过 CDN 缓存,您可以在 POST

中包含 invalidate 参数

您可以在此处阅读更多相关信息: https://cloudinary.com/documentation/image_upload_api_reference#rename