Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
pp111
4 months agoExplorer | Level 4
Large files download fails after 1 hour
Hello,
I am downloading files with the Dropbox API correctly using "https://content.dropboxapi.com/2/files/download"
However, when the file download takes longer than 1 hour (exactly), the Dropbox server closes the connection and the download is broken. I tested it with several tools with the same result, also using directly cUrl.
You can reproduce the issue with the following steps:
- Upload a file larger than 700MB to your Dropbox root folder named lagefile.bin
- Create the folder C:\Tests on your local drive
- Execute the following command
curl -X POST https://content.dropboxapi.com/2/files/download --header "Authorization: Bearer *****replace with your access token******" --header "Dropbox-API-Arg: {\"path\": \"/largefile.bin\"}" --output C:\Tests\largefile.bin --limit-rate 120K
After exactly 1 hour (and a few seconds) the connection the following error is displayed:
curl: (56) schannel: server closed abruptly (missing close_notify)
In the cUrl command I am using --limit-rate to make sure the download takes more than 1 hour
I did not see any limit in the API documentation about the time that can take a download, so I think it might be a bug on the Dropbox server API.
Hi pp111,
Thank you for providing this information.
The connections for these Dropbox API download calls are limited to one hour.
If you need to perform downloads over longer periods (i.e., more than an hour), please issue multiple download requests, each lasting no longer than an hour, to retrieve a portion of the file per request. You can then reassemble the file afterward.
To support downloading large files in parts, the API supports Range Retrieval Requests, which allow files to be downloaded in segments. Here’s a sample curl command for reference:
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-2"The above curl command will download only the first three bytes of the file at /test.txt. You can adjust the byte range to download any portion of the file, such as when continuing with the next portion.
2 Replies
Replies have been turned off for this discussion
- pp1114 months agoExplorer | Level 4
Thank you for the information
- iNeil4 months ago
Dropbox Community Moderator
Hi pp111,
Thank you for providing this information.
The connections for these Dropbox API download calls are limited to one hour.
If you need to perform downloads over longer periods (i.e., more than an hour), please issue multiple download requests, each lasting no longer than an hour, to retrieve a portion of the file per request. You can then reassemble the file afterward.
To support downloading large files in parts, the API supports Range Retrieval Requests, which allow files to be downloaded in segments. Here’s a sample curl command for reference:
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-2"The above curl command will download only the first three bytes of the file at /test.txt. You can adjust the byte range to download any portion of the file, such as when continuing with the next portion.
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!