Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
I am using the Swift Version.
Essentially, I am listing the contents of a directory on Dropbox, and filtering for a specific type (which in my case is PNG).
Basically what I need to know, is whether there is a way of being notifiied when the listing of the files has been completed?
Any help would be great 🙂
func listRemotelySavedFiles(validType:String){ //1. List The Files If Any if let client = DropboxClientsManager.authorizedClient { client.files.listFolder(path: storageVault, recursive: true, includeMediaInfo: true, includeDeleted: false, includeHasExplicitSharedMembers: false).response(queue: DispatchQueue(label: "Tests"), completionHandler: { (response, error) in if let result = response { for entry in result.entries { if let details = entry as? Files.FileMetadata{ let entryName = entry.name as NSString let pathExtension = entryName.pathExtension // Only Make Reference To Valid File Types if pathExtension == validType { self.dropBoxDataVault[entry.name] = [entry.pathLower!, details.contentHash!] print("Unique Hash For Remote File \(entryName) == \(details.contentHash!)") } } print("Completed *________*") } //If The User Folder Is Very Big We Need To Call List Continue & Continue To Extract The Data From The Remote Files repeat { client.files.listFolderContinue(cursor: result.cursor).response(completionHandler: { (response, error) in self.remoteFileCount = result.entries.count if let result = response { for entry in result.entries { let entryName = entry.name as NSString let pathExtension = entryName.pathExtension // Only Make Reference To Valid File Types if pathExtension == validType { self.dropBoxDataVault[entry.name] = [entry.pathLower!, self.generateRemoteHashTagForFile(path: entry.pathLower!)] } } }else{ print("An Error Occured Continuing To List The Folder") } }) } while result.hasMore == true } else { print("Error Loading Files") } } )} }
Josh,
Can you share the final working code to list all the items in a folder. I have a folder where there are more then 5000 folders.
Thanks,
Koray Birand
Hi there!
If you need more help you can view your support options (expected response time for a 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!