Migration path for permanently moving Rails static images to Cloudinary
Hi,
Browsed the docs for a bit, but couldn't find the answer to how to migrate images from Rails to Cloudinary permanently.
With this script:
rake cloudinary:sync_static
I'm able to upload all assets quickly and easily. However:
1. How do I rename those images on cloudinary?
There is a hash appended to each public id, I would like to keep just the file name. The usual 'rename' button is not there when I click on image profile page.
2. How do I move those files to folders?
They all got uploaded at root level, and folders inside of images/ folder on rails weren't transferred. When I click "move to folder", there seems to be a bug and nothing happens.
Thanks!
-
Hi Kelly,
The answer to both your questions is to use the rename method.When you rename a file, you could specify the folder you want the file to be in, and this would either create the folder if does not already exist or move the file to that folder if it exists.
So for example, if you perform the below call it would rename the file "blue_lake" to "blue_lake1" and move the file to the "sample" folder
Cloudinary::Uploader.rename("blue_lake", "sample/blue_lake1", options = {})
Let me know if that helps?
Thanks,
Ido
Post is closed for comments.
Comments
1 comment