We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Bobby I
5 years agoExplorer | Level 4
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.
- Greg-DBDropbox Staff
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 IExplorer | Level 4
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-DBDropbox Staff
No, unfortunately I can't think of any other workarounds for this.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 4 hours agoIf 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 or Facebook.
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!