Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Sam F.6
8 years agoNew member | Level 2
SwiftyDropbox - Read User's File Structure
What's the best way to setup a collection view emulating the file/folder structure the user has on their account? I know if I use the recursive method it'll take ages before it fully finishes depending on the user, which is absolutely understandable. So I guess I'm just curious what the best way of calling and retrieving the data would be? I believe I'd be calling:
listFolder(path: String, recursive: = true, includeMediaInfo = true)
and once a response returns pass in the folder's cursor and call:
listFolderContinue(cursor: String)
Is this the direction I should be headed? Any help is greatly appreciated.
1 Reply
- Greg-DB8 years ago
Dropbox Community Moderator
First, for reference, using listFolder and listFolderContinue is the right way to get the metadata for the files and folders in an account. Whether or not you use the recursive=true, you should call listFolder first, and then call back to listFolderContinue using that returned cursor, if instructed to do so by hasMore. (The documentation has more information on how to process these.
If you need all of the entries for an account together/at once, you should use recursive=true. As you noted that though, that can take some time if the user has many items.
If you don't need everything at once, e.g., if you want to just display one folder at a time as the user browses through them, you can use recursive=false, and just list the next folder on demand. It sounds like that's what you're looking for here.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!