【问题标题】:how can I change the name of an image in cloudinary from the api如何从 api 更改 cloudinary 中图像的名称
【发布时间】:2018-03-14 07:26:37
【问题描述】:

例如我有这张图片:

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

【问题讨论】:

    标签: cloudinary


    【解决方案1】:

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

    cloudinary.v2.uploader.rename(from_public_id, to_public_id, options, callback);

    在你的情况下:

    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

    【讨论】:

    • 不可能用jquery来做吗?
    • 在客户端?
    猜你喜欢
    • 2018-10-05
    • 1970-01-01
    • 2019-01-05
    • 2019-08-08
    • 1970-01-01
    • 2023-04-10
    • 2013-09-01
    • 2019-09-20
    • 2011-05-30
    相关资源
    最近更新 更多