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
Sukanth
5 years agoExplorer | Level 4
is there a way we can resume downloads from where it left ?
Hi Guys,
I wrote code using dropbox java sdk to download all the files in dropbox to my NAS (Network-attached storage). The data is huge . I tried to make the process faster using thread pool exec...
- 5 years ago
Yes, it looks like in that case you've only written a portion of the file, so you could check how much of the file you did write, and then use DbxDownloadStyleBuilder.range to download just the rest of the file.
Also, if it's helpful, you can use the "Content Hash" feature, available in the Java SDK as FileMetadata.contentHash, to verify if you've successfully downloaded the full and correct file contents.
Greg-DB
Dropbox Staff
For cleaning up after failed operations, if an API call fails when you're using the Java SDK, it should raise an exception you can catch so you can perform whatever cleanup you need, such as deleting local files.
For restarting downloads, you can actually use DbxDownloadStyleBuilder.range to restart a download at whatever point in the file you need. There's an example of using that in test test code here.
Sukanth
5 years agoExplorer | Level 4
when I say partially downloaded. I mean like the one in the above picture .when I stop the program abruptly this happens because the output stream is interrupted before the file is fully written on disk. Can you suggest anything to handle this case?
- Greg-DB5 years agoDropbox Staff
Yes, it looks like in that case you've only written a portion of the file, so you could check how much of the file you did write, and then use DbxDownloadStyleBuilder.range to download just the rest of the file.
Also, if it's helpful, you can use the "Content Hash" feature, available in the Java SDK as FileMetadata.contentHash, to verify if you've successfully downloaded the full and correct file contents.
- Sukanth5 years agoExplorer | Level 4
Thank you, Greg !!
- Здравко5 years agoLegendary | Level 20
Hi Greg-DB,
I would ask you, why the range you mention isn't documented in HTTP documentation: https://www.dropbox.com/developers/documentation/http/documentation#files-download ? Could this lack of completeness be corrected?
ADD: For upload also.
- Greg-DB5 years agoDropbox Staff
Здравко The Dropbox API actually supports range requests for all content-download style endpoints in general, so it's mentioned in the "Content-download endpoints" documentation. That could definitely be expanded on though, so I'll ask the team to improve that. Thanks!
About Discuss Dropbox Developer & API
Make connections with other developers797 PostsLatest Activity: 8 days ago
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 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!