Use Filename Without Underscores
I want to upload an image and keep the original filename with spaces. I'm including the "use_filename" param, but I noticed that the spaces for the filename is replaced with underscores. For example, I want to upload an image where the id is the original filename, "my mom", but the result I got was "my_mom". What can I do here? I'm using the direct upload feature from the photo album sample. https://github.com/cloudinary/cloudinary_npm/tree/master/samples/photo_album
-
Hi,
You can use the parameter public_id upon upload to preserve the spaces in your resource's ID. So an example would look like:cloudinary.v2.uploader.upload("my_mom.jpg", { public_id: "my mom" });
Please just note that the URL for this resource will have '%20' inserted in the blank spaces for the browser to be able to parse. So an example URL would look like this:
http://res.cloudinary.com/demo/image/upload/my%20mom.jpgI hope this helps!
Thanks,
Marissa0
Post is closed for comments.
Comments
1 comment