Deliver an Image from a folder using the Javascript SDK
I am trying to deliver an image using the cloudinary javascript SDK. On the documentation, the code sample given is:
cl.url("sample.jpg", { width: 400, crop: "pad"})
How do I retrieve an image that is stored in a folder I created on cloudinary e.g userPhotos
0
-
Hi George,
Any resource within one or more folders will have the full path to the resource as its public_id. For example, if you had an image sample.jpg under the folder userPhotos then its public_id would be userPhotos/sample.jpg.
You can then use the url method just like the original example but only updating it to use the new public_id:
cl.url("userPhotos/sample.jpg", { width: 400, crop: "pad"});
Could you try this with one of the images in your account that is in a folder?
Let me know how this goes and if you have any further questions.
Best regards,
Aleksandar
0
Post is closed for comments.
Comments
1 comment