Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Bobby I's avatar
Bobby I
Explorer | Level 4
6 years ago
Solved

Calculating folder size using C# SDK

I was looking into calculating total file size within a folder programmatically for display purposes. I have a method that calls DropboxClient.ListFoldersAsync with the path and recursive set to true, then iterate through each of the objects that are MetaData.IsFile and adds the size. The FileMetaData.Size for .paper or .gdoc file types always have the same value (ulong 75), so it makes me believe it is a pointer to where the file is actually stored. I looked into the Network tab when clicking Calculate Size in Dropbox and saw it made a request to

https://www.dropbox.com/2/folders/get_subfolder_sizes_in_same_namespace

and

https://www.dropbox.com/2/folders/get_shared_subfolder_sizes

Is there a way to get the actual file size for these cloud file types, or is there a helper method in the Dropbox SDK to achieve the same calculations as is possible through Dropbox's GUI?

  • No, unfortunately I can't think of any other workarounds for this.

3 Replies

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

    The public Dropbox API doesn't offer a direct way to get the total size of a folder, or to get the size of cloud file content, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though. The functionality you found on the web site is not part of the public Dropbox API unfortunately.

  • Bobby I's avatar
    Bobby I
    Explorer | Level 4
    6 years ago

    I see, that's too bad. Has there been any decent workarounds you have encountered to simulate this functionality using the public API? I guess there is a reason Dropbox hasn't implemented this just yet publicly, so maybe this question is too forward.

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

    No, unfortunately I can't think of any other workarounds for this.

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!