cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calculating folder size using C# SDK

Calculating folder size using C# SDK

Bobby I
Explorer | Level 4
Go to solution

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?

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

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
Explorer | Level 4
Go to solution

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
Dropbox Staff
Go to solution

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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Bobby I Explorer | Level 4
What do Dropbox user levels mean?