Error while downloading file
See original GitHub issueHello. I encountered an error when downloading large files. File is not fully downloaded error occurs
'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.resources\v4.0_4.0.0.0b03f5f7f11d50a3a\System.Net.Http.resources.dll'. Module was built without symbols.
Exception thrown: 'System.IO.IOException' in System.Net.Http.dll
Exception thrown: 'System.IO.IOException' in mscorlib.dll
The impression is that the server is disconnected because the file transfer takes longer.
Using code:
private async Task DownloadFile(DropboxClient client, string filePath, string localFilePath)
{
using (var response = await client.Files.DownloadAsync(filePath))
{
using (var fileStream = File.Create(localFilePath))
{
response.GetContentAsStreamAsync().Result.CopyTo(fileStream);
}
}
}
Also an error occurs if you simultaneously download two or more files.
I hope for help in this matter.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Fix file download errors - Google Chrome Help
To fix the error: Cancel the download and try again. Instead of clicking the file to download, right-click the link and select Save...
Read more >8 Ways to Fix the “Download Failed Network Error” on ...
8 Ways to Fix the “Download Failed Network Error” on Chrome · 1. Check Your Internet Speed and Connection · 2. Modify Your...
Read more >While downloading getting errors (Failed
All files I have downloaded successfully all zipped files except 5 files numbers 257, 259, 260, 262, 263. When download process (using google ......
Read more >How to Fix a Download Failed Network Error in Chrome
Another thing you can do to fix a download failed network error is reset Chrome and restore it to its default settings. Resetting...
Read more >How to Fix the "Download Failed Network Error" Issue in ...
To fix a failed download in Chrome, ensure your internet connection is working, reboot your computer, save your file in a different location...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@GitHubUniverse Thanks for the additional output! It looks like this may be due to a timeout. Please try setting longer timeouts like the example here:
https://github.com/dropbox/dropbox-sdk-dotnet/blob/master/dropbox-sdk-dotnet/Examples/SimpleTest/Program.cs#L68
@greg-db Thank you very much.
Now download works correctly. I can easily download files.
I added the reference to System.Net.Http.WebRequest, and made a change to the download method, adding from an example:
And also your example is working correctly.