You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
rabbigarfinkel
8 years agoExplorer | Level 4
Downloading file with Swiftydropbox
I have successfully installed Swiftydropbox and my app successfully registers with Dropbox. But I don't understand what to do now if I want to download from a Dropbox. My goal is to download a text ...
- 8 years ago
That code doesn't list or display any files. It only downloads a file at "/Documents/RamKolText2.txt".
If you want to get a list of files to display to the user, you can use listFolder and listFolderContinue.
rabbigarfinkel
Explorer | Level 4
Thank you. The problem is that I would not know the filepath of a user's selected file. In the code below, what line is supposed to trigger the display of the user's files so that the user can tap on a file and return that path to my app?
// Download to URL let fileManager = FileManager.default let directoryURL = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] let destURL = directoryURL.appendingPathComponent("/Documents/RamKolText2.txt") let destination: (URL, HTTPURLResponse) -> URL = { temporaryURL, response in return destURL } client.files.download(path: "/Documents/RamKolText2.txt", overwrite: true, destination: destination) .response { response, error in if let response = response { print(response) } else if let error = error { print(error) } } .progress { progressData in print(progressData) }
Thanks!
Greg-DB
8 years agoDropbox Staff
That code doesn't list or display any files. It only downloads a file at "/Documents/RamKolText2.txt".
If you want to get a list of files to display to the user, you can use listFolder and listFolderContinue.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,911 PostsLatest Activity: 10 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!