Skip to main content

How to rename public id?

Answered

Comments

15 comments

  • Tal Lev-Ami

    Indeed renaming a public_id after it's creation is supported. 

    There is a rename method in each of the client libraries

    0
  • OhFry

    I don't use the library. What about renaming after the upload through the interface on https://cloudinary.com/console/media_library ?

    0
  • Itay Taragano

    You can do it via the console by re-uploading the image using the new public_id, and deleting the old one.

    It is in our road-map to add the ability to rename from the media library

    0
  • Teresa Murphy

    Any update on when this might be possible via the console? Deleting and reuploading doesn't work well when transformations are cached and won't go away.

    0
  • Glenn Goodrich

    +100  This really needs to be in the dashboard.

    0
  • Itay Taragano

    Hi Teresa and Glenn, thank you for your responses.

    Renaming via the Media library is still on our road-map and should be added in the near future.

    We will update here when this is available.

    Note that deleting and re-uploading an image also invalidates cached copies in the CDN. It might take up to one hour for the invalidation to fully propagate.

     

    0
  • Itay Taragano

    UPDATE

    Renaming can be done now interactively via the Media Library.

    This can be done by choosing the required image and click on Rename.

    Rename

    0
  • Teresa Murphy

    WHOOHOO!!!! Thank you so very very much!!!!

    0
  • Diego Pamio

    Any handy tool or script out there to rename to remove the tailing random id that was added during upload?

    0
  • Nadir Latif

    See my project: https://github.com/nadirlc/Public-API-Functions. It removes the random text that is automatically added to the uploaded files.

    0
  • Nadav Ofir

    Diego, We don't possess such a script, but this can be easily done using a combination of Admin-API instructions for listing your resources, and the rename method for chopping off the random suffix.

    If you require assistance, feel free to open a ticket at:
    http://support.cloudinary.com/tickets/new

    0
  • Nadav Ofir

    By the way, you can prevent Cloudinary from adding random characters to the public_id during the upload.
    More information in the following link:
    http://support.cloudinary.com/hc/en-us/articles/202520812-Why-does-the-public-ID-include-additional-characters-appended-to-the-original-file-name-

    0
  • Philip Auriemma

    I am currently looking at this page: http://cloudinary.com/documentation/admin_api#update_resources and cannot find the rename method mentioned in the comments.

    I would greatly appreciate this method so I can write a script to rename our 50,000 ish images.

    0
  • Itay Taragano

    The `rename` API's documentation can be found here:
    http://cloudinary.com/documentation/image_upload_api_reference#rename

    Also, it's documented under our specific frameworks' documentation, e.g., Python/Django:
    http://cloudinary.com/documentation/django_image_upload#rename_images

    0
  • Philip Auriemma

    Thank you!

    0

Post is closed for comments.