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
bambaba12
10 months agoExplorer | Level 4
ECONNRESET while downloading shared file as a stream
Hello, when I try to download a shared file using API , the socket closes at the 10th minute, and I receive an 'ECONNRESET' error. Without using the API, I was able to download for an hour. And after an hours it's closing the connection again. By the way, the file I'm downloading is over 100GB. Can you help me with this issue?
await this.httpService.axiosRef({
url: 'https://content.dropboxapi.com/2/sharing/get_shared_link_file',
method: 'POST',
headers: {
Authorization: `Bearer ${DROPBOX_API_TOKEN}`,
'Dropbox-API-Arg': JSON.stringify({ url: videoUrl }),
'Content-Type': 'application/octet-stream',
},
responseType: 'stream',
});
We've increased the /2/sharing/get_shared_link_file endpoint timeout. For downloads that will take a long time, please use Range requests to retrieve the entire file across multiple requests as described in my previous message.
- Greg-DBDropbox Staff
Thanks for the report! It looks like the /2/sharing/get_shared_link_file endpoint is configured with a 10 minute timeout. I'll ask the team to look into whether we can increase that.
As a workaround, whether you're using this /2/sharing/get_shared_link_file endpoint or are downloading from the shared link directly, you can use "Range" requests to download a portion of the file at a time.
So if you need to perform these downloads over periods of time longer than the relevant timeout, please use multiple requests lasting no longer than the timeout, to download a piece of the file per request, and then re-assemble the file.
For example, here's a sample of what it would look like in curl:
curl -v -X POST https://content.dropboxapi.com/2/sharing/get_shared_link_file \ --header 'Authorization: Bearer ACCESS_TOKEN' \ --header 'Dropbox-API-Arg: {"url":"SHARED_LINK"}' \ --header 'Range: bytes=0-10'
That would download just the first 11 bytes of the file at the shared link. You can modify the byte range to download any piece of a file, such as to continue downloading the next portion of a file.
- Greg-DBDropbox Staff
We've increased the /2/sharing/get_shared_link_file endpoint timeout. For downloads that will take a long time, please use Range requests to retrieve the entire file across multiple requests as described in my previous message.
- bambaba12Explorer | Level 4
Thank you. Yes, as you suggested, I started using range, and this has been more effective
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,883 PostsLatest Activity: 12 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!