getting full path of folders
Hi,
I am able to use api to get list of folder names and paths. I am getting only the name of the folder for the path part. Example if I have folders (folder1 and folder2), the names and paths are the same (name: folder1 and path: folder1). How to get the full path of the folder?
Best Answer
-
Hi @rwahdan ,
Thanks for contacting Cloudinary.
You should be able to see the full path. For example, I used the below code with prefix as Folder 1. Folder 1 has Folder2 and Folder2 has Folder3.
cloudinary.api.resources({prefix:"Folder 1",
type:"upload"
},
function(error, result) {console.log(result, error); });
Below is the output:
resources: [
{
asset_id: 'f3420ed12c15b5d934d09e13de9a3aed',
public_id: 'Folder 1/Folder2/Folder 3/Screenshot',
format: 'png',
version: 1662685030,
resource_type: 'image',
type: 'upload',
created_at: '2022-09-09T00:57:10Z',
bytes: 1000592,
width: 3436,
height: 1416,
asset_folder: 'Folder 1/Folder2/Folder 3',
display_name: 'Screenshot',
access_mode: 'public',
secure_url: 'https://res.cloudinary.com/sreecloudinary/image/upload/v1662685030/Folder%201/Folder2/Folder%203/Screenshot.png',
metadata: [Object],
last_updated: [Object]
},
Can you please provide your sample code?
Thanks,
Sree
0