Search code examples
apidropboxdropbox-apicloud-storage

Get directory tree of a users dropbox


I have an app which integrates with dropbox, I want the user to select a folder from their dropbox.

I can call '/2/files/list_folder' (https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder) with recursive set to true, and then recursively call it based on the returned cursor. I then filter out any which aren't directories. But this is a long slow process, and unpredictable given the potential size of some users directory tree on Dropbox.

I know there is a dropbox file select plug in (https://www.dropbox.com/developers/chooser), but I want to make a folder select, with no option to select a file.

What I would like is one api call that returns a list of all directories for a user.

Does this exist with an API method I don't know about? Or is there another widget that allows folder selection?

I've seen this question which just does a recursive api call too, not practically efficient.


Solution

  • The Dropbox API v2 doesn't offer a way to list only folders like that, but we'll consider it a feature request.

    Dropbox also doesn't offer a component like the Chooser that allows folder selection, but we'll consider that a feature request as well.