Can the NodeJS API wrapper return only the URL?
Is there a way in the Cloudinary Node.js wrapper to get only the URL, rather than the entire <img src=''http://cloudinary.com/4eroigwje9rgjwe9rj.jpg" width=100/> string?
I can split it off via Javascript- just wondering if there was a method for doing this.
Thanks
-
Hi,
You can use
cloudinary.url
instead ofcloudinary.image
, this method receives the exact same arguments, but returns just the image URL instead of the actual image tag.For example:
cloudinary.url("sample.jpg", { width: 100, height: 150, crop: 'fill' })
will return:
"http://res.cloudinary.com/<your\_cloud\_name>/image/upload/c_fill,h_150,w_100/sample.jpg"
0 -
Thank you very much! I should have guessed there was a method for this. Many thanks!
0 -
Hi thanks for this! also i want to ask, is there a way to return https url in cloudinary.url?
THank you!
0 -
You can generate an HTTPS URL by setting `secure` to `true`. For example:
cloudinary.url("sample", {width:300, height: 300, secure: true})
0
Post is closed for comments.
Comments
4 comments