Why does the public ID include additional characters appended to the original file name?

When uploading an image through the Dashboard's 'Media library', or through the API (when use_filename is set to true and no custom public ID is given),  Cloudinary automatically append a random short string to the end of the image's name in order to avoid two images sharing the same public ID.

However, Cloudinary still keeps the original file's name. Therefore, when delivering the images using the attachment flag (fl_attachment in URLs), the file will be delivered as an attachment with the original file's name.

For example, here's an image uploaded to Cloudinary, originally called sample, Cloudinary automatically generated its public ID to be sample_vwstin:
http://res.cloudinary.com/demo/image/upload/v1372324995/sample_vwstin.jpg
Using the same URL with the attachment flag will deliver the image, using its original name:
http://res.cloudinary.com/demo/image/upload/fl_attachment/v1372324995/sample_vwstin.jpg

This behavior can be changed when using the API. See: http://support.cloudinary.com/hc/en-us/articles/202520762-How-to-upload-images-while-keeping-their-original-filenames-

UPDATE

You can now set "Use file name in Media Library" in your account's Upload settings page to tell Cloudinary to not add random characters in the root directory either.

Have more questions? Submit a request

Comments

Powered by Zendesk