Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
gagsbh
8 years agoHelpful | Level 5
Large File Download
Hello,
I used Dropbox SDK for .NET to download a large file of size 1.3 GB but the program hung.
using (var response = await dbx.Files.DownloadAsync(path + "/" + file)) { byte[] bu...
- 8 years agoYou appear to be trying to read the entirety of the contents into memory, which is likely to fail for large files like this.
You'll probably want to use GetContentAsStreamAsync in the SDK (instead of GetContentAsByteArrayAsync), so you can access the contents via a stream, instead of reading it all into memory:
https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Stone_IDownloadResponse_1_GetContentAsStreamAsync.htm
Greg-DB
Dropbox Community Moderator
8 years agoYou appear to be trying to read the entirety of the contents into memory, which is likely to fail for large files like this.
You'll probably want to use GetContentAsStreamAsync in the SDK (instead of GetContentAsByteArrayAsync), so you can access the contents via a stream, instead of reading it all into memory:
https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Stone_IDownloadResponse_1_GetContentAsStreamAsync.htm
You'll probably want to use GetContentAsStreamAsync in the SDK (instead of GetContentAsByteArrayAsync), so you can access the contents via a stream, instead of reading it all into memory:
https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Stone_IDownloadResponse_1_GetContentAsStreamAsync.htm
- gagsbh8 years agoHelpful | Level 5
Thanks! It worked.
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!