Questions tagged [downloadfileasync]

Downloads the specified resource to a local file as an asynchronous operation and returns a task object. These methods do not block the calling thread.

71 questions
8
votes
4 answers

Is WebClient.DownloadFileAsync really this slow?

I'm using the DownloadFileAsync method of WebClient to download some files from a server, and I can't help but notice that in my informal testing of my code within VS2010, it blocks for about 3 seconds while it starts, which, in my opinion kind of…
davidtbernal
  • 13,434
  • 9
  • 44
  • 60
6
votes
1 answer

WebClient DownloadFileAsync hangs

Good day. I'm working on file downloader class using DownloadFileAsync. In normal situations everything works fine. But when I'm downloading file and disable network connection, downloading progress is just stops for infinite time, without raising…
mxpv
  • 946
  • 2
  • 10
  • 31
6
votes
1 answer

How to Set TimeOut for WebClient on .net?

I download some file but I also want to set timeout for webclient. As I see there is no change just We can use overriding WebRequest. I already did but It doesnt work. I mean tht overriding of GetWebRequest method doesnt work.. Here are my codes …
unbalanced
  • 1,192
  • 5
  • 19
  • 44
4
votes
1 answer

Download cancel delay in Xamarin Forms

I need to download a pdf file and save in device. I have used WebClient process to download a file and show progress while downloading it. CancellationTokenSource Token= new CancellationTokenSource(); //Initialize a token while start…
4
votes
3 answers

Why I can't have more than 5 WebClient.DownloadFileAsync running?

I'm trying to test another application by requesting many file downloads. So, I started 10 WebClient instances with following code, but seems I can have just 5 running at same time. class Program { public static object locker = new object(); …
Rubens Farias
  • 57,174
  • 8
  • 131
  • 162
4
votes
2 answers

How can I download a file using WebClient in C# with firing the eventhandlers and supporting the timeout property?

I'm developing a C# project to download the files from the internet. I'll show the progresses of them while the downloads are going. And I should support the time-out property. I've tried to use the WebClient class. There are DownloadFile() and…
Yun
  • 5,233
  • 4
  • 21
  • 38
3
votes
0 answers

write large data on file using excel4node and download it using alot of time and blocks all other I/O Operations

i am fetching large number of data approximately 250000+ rows from mongodb collection and writing that data on file using excel4node library.But the issue is all other I/O operations gets blocked and the request itself gets stalled but when i try to…
Benson OO
  • 477
  • 5
  • 22
3
votes
2 answers

Android download apk file and save to INTERNAL STORAGE

I have been stuck for days when developing a function that allow user to check for new app update (I use local server as my distribution point). The problem is the downloading progress seems working perfectly but I could not find the downloaded file…
3
votes
3 answers

Optimal number of parallel downloading files

I'm trying to simultaneously download multiple files. How am I to determine an optimal number of files to download in parallel?
aush
  • 2,108
  • 1
  • 14
  • 24
2
votes
2 answers

DownloadFile stopped downloading file

I have an updater application that is being started when an update is available. This application is simply downloading a new exe to a specified path, but suddenly it is not working anymore. The updater downloads the file with a size of 0kb and does…
Salihan Pamuk
  • 175
  • 1
  • 2
  • 13
2
votes
2 answers

DownloadFileCompleted doesn't work immediately after a download-completed event in C# winform?

development environment: C#, visual studio 2010 (.net 4.0), win7 x64 codes in winform project: private void Form1_Load(object sender, EventArgs e) { string path = "c:\\1.jpg"; for (int i = 0; i < 10; i++) { …
JQY
  • 91
  • 3
2
votes
2 answers

WebClient DownloadFileAsync() does not work

WebClient DownloadFileAsync() does not work with the same URl and Credentials... Any clue? static void Main(string[] args) { try { var urlAddress = "http://mywebsite.com/msexceldoc.xlsx"; …
NoWar
  • 36,338
  • 80
  • 323
  • 498
2
votes
2 answers

C# DownloadSync event not fired

Experimenting with WebClient.DownloadFileAsync: public void DownloadFile(string fileUrl, string localFile) { using (WebClient client = new WebClient()) { downloadingFile = true; client.DownloadFileCompleted +=…
Louisa
  • 552
  • 1
  • 9
  • 22
2
votes
1 answer

WebClient not downloading full file?

I have a WebClient downloading a .chm file (as seen in the code below). It seems to be very irregular in what it is downloading. The full file size is around 2500-2600 KB but about 50-75% of the time I get files back that are smaller (some examples:…
Broots Waymb
  • 4,713
  • 3
  • 28
  • 51
2
votes
2 answers

2 Progress Bars for multiple file downloads

At the moment I have a queue system that places all of the links to download files from and it downloads them one by one. What I have been trying to do is have not 1 but 2 progress bars. The top progress bar will be for the progress of the current…
avgcoder
  • 372
  • 1
  • 9
  • 27
1
2 3 4 5