How do I find out the total size of a folder in cloudinary?
-
Official comment
You can now view the folder size and number of assets included in the folder from the Media Library UI. To do this, make sure that your preview pane is open - just click on Open Preview appearing as an 'eye' button on the top right side of the screen. Then, simply click once on the folder and you will then see the information presented in the preview pane.
Comment actions -
We did not find a way. So we created this script
https://gist.github.com/SindreSvendby/96d98860e2c2c399dc8f53cf55fbe67a
-
Here is a sample code to get the folder size:
https://gist.github.com/shirlymanor/8cd8b95e1132be19eb8cd5e7363828ff
-
Hi David,
Currently, there is no direct API call you can make to get this info, as Millie wrote above you can view the folder size and number of assets included in the folder from the Media Library UI, or you can use this workaround via the API - you can list all resource within a specific folder using the
prefix
parameter. The API response includes abytes
parameter for each resource, which you can use to calculate the overall size of the folder. For example https://gist.github.com/shirlymanor/8cd8b95e1132be19eb8cd5e7363828ff
Post is closed for comments.
Comments
12 comments