Set the image name
Hi
I need to set the image names to include some 'application logic' such as attaching it to a specific user by her name.
How can I do it?
Thanks
Shuky
-
Hi Shuky,
You can specify your own custom public ID to any of your images, either while uploading, or renaming an already uploaded image.
In addition, your images' public ID can also contain a prefix (e.g., "user1-..."), and even one or more folders (e.g., "user1/myfolder/...").
Here are two examples of specifying a custom public ID while uploading (in Rails):
Cloudinary::Uploader.upload('my_image.jpg', :public_id => 'john_doe_1001')
Cloudinary::Uploader.upload('my_image.jpg', :public_id => 'my_folder/my_sub_folder/my_name')You can also store your images in folders while keeping the images' original file names. For more information:
http://support.cloudinary.com/entries/25760887-Can-I-upload-files-to-a-folder-while-keeping-their-original-file-names-0
Post is closed for comments.
Comments
1 comment