get publicId of all images on cloudinary
How can I fetch public-id's of all the images uploaded on cloudinary, using cloudinary.ListResources provides only 10 at a time and that too complete information.
I just want public id's and that too of all the images uploaded.
Thanks, Harish
-
Hi Harish,
ListResources returns an object that holds the resources' data.
Please note that you can set MaxResults to be larger than 10 (up to 500).
For example,
ListResourcesResult res = new ListResourcesResult();
ListResourcesParams resParam = new ListResourcesParams()
{
MaxResults = 500
};
res = cloudinary.ListResources(resParam);
foreach (var resource in res.Resources){
Console.WriteLine(resource.PublicId);
} -
Hi Harish,
We currently don't support getting only custom field in a response but it sounds interesting so I added it as a feature request in your behalf:)
I'll gladly let you know if and when it's ready and published.
In the meantime, the response holds the basic information on an image (public_id, upload time, version, etc.)
Please note that it's recommended to save the version together with the public_id in your records to serve the latest image.
Hope it helps.
Best,
Post is closed for comments.
Comments
3 comments