Answer the question
In order to leave comments, you need to log in
Why is an empty file being downloaded via the Web Client?
Invoke(new EventHandler(delegate
{
var Client = new WebClient();
Client.DownloadFileCompleted += new AsyncCompletedEventHandler(Client_DownloadFileCompleted);
Client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(Client_DownloadProgressChanged);
Client.DownloadFileAsync(new Uri($"{ServerUrl}{File.Path}"), Path.GetFileNameWithoutExtension(File.Path));
}));
Answer the question
In order to leave comments, you need to log in
Specify the user-agent request header, as in the browser. Perhaps before requesting a file, you will need to request the page from which it is downloaded.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question