Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello,
I daily need to download a file into iOS from Dropbox using API.
The file is ~1GB.
Whether the screen saver occurs, or under some other conditions (incoming calls), then the download is aborted, I can restart it, but not resume it from where it left.
It is quite frustrating since it happens frequently.
Is there a way to resume a partial download or force dividing download into smaller parts ?
Thanks
Sure, you can use this by setting the "Range" header. You can find information on the syntax in the spec. For example, here's a call that would download only bytes 0 through 5:
curl -X POST https://content.dropboxapi.com/2/files/download \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Dropbox-API-Arg: {\"path\": \"/test.txt\"}" \ --header "Range: bytes=0-5"
And here's an example that would download everything from byte index 6 to the end:
curl -X POST https://content.dropboxapi.com/2/files/download \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Dropbox-API-Arg: {\"path\": \"/test.txt\"}" \ --header "Range: bytes=6-"
Hope this helps!
Are you using one of the official Dropbox SDKs? If so, which one?
The API itself does support "Range Retrieval Requests", e.g., on /2/files/download, but not all of the SDKs implement that.
Hello,
thanks for your answer.
I actually using the /2/files/download API
I do not know how to add/implement "Range Retrieval Requests".
Can you provide some examples or suggestions ?
Sure, you can use this by setting the "Range" header. You can find information on the syntax in the spec. For example, here's a call that would download only bytes 0 through 5:
curl -X POST https://content.dropboxapi.com/2/files/download \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Dropbox-API-Arg: {\"path\": \"/test.txt\"}" \ --header "Range: bytes=0-5"
And here's an example that would download everything from byte index 6 to the end:
curl -X POST https://content.dropboxapi.com/2/files/download \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Dropbox-API-Arg: {\"path\": \"/test.txt\"}" \ --header "Range: bytes=6-"
Hope this helps!
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!