Forum Discussion

ererr's avatar
ererr
Explorer | Level 3
7 years ago

Get Size of a Folder

How can i get the size of a particular folder in DropBox using V2 call or V1 please solve this...?

7 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago

    The Dropbox API doesn't offer a direct way to get the total size of a folder's contents, but I'll pass this along as a feature request. 

    If you need to know the total size of the contents of a folder, you'd need to list all of the contents using /2/files/list_folder[/continue] and then sum up the `size`s for all of the files. (You can use the `recursive` parameter on /2/files/list_folder to request nested files too.)

  • bellomsean's avatar
    bellomsean
    Helpful | Level 5
    5 years ago

    Greg-DB

    Is it now possible to get the size of a folder?
    or we still need to do it manually as you said?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    bellomsean No, unfortunately the API still doesn't offer a way to do this directly, so you'd still need to calculate the sum.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    4 years ago

    LouisCorleone Yes, that's correct. The Dropbox API still doesn't offer a way to retrieve this value directly.

  • julio_diniz_perdigao's avatar
    julio_diniz_perdigao
    Explorer | Level 3
    2 years ago

    I do suggest store the file size into database, which will be more faster to sum than call the api.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!