We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Aurelian R.
11 years agoNew member | Level 1
Download a file from the Dropbox account into an output stream.
Hello
I download a file from Dropbox using the following code from the Dropbox API:
public final OutputStream downloadDropBoxFileAtOutputStream(final String dropBoxFilePath, String localFilePat...
Greg-DB
Dropbox Community Moderator
11 years agoThe getFile method will just write the file contents to whatever OutputStream you supply, which doesn't necessarily need to be a FileOutputStream like the example in the documentation shows. That being the case, you supply a different kind of OutputStream to send the data to wherever you want. For example, a PipedOutputStream may make sense, depending on your scenario.
Alternatively, you may want to use startGetFile which returns a DbxClient.Downloader instead, which has an InputStream with the file's contents as the body field, which may suit your use case better.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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!