I have a single exe file of size 164 MB in server for installing an sccm package. I am trying to download this file to client machine using a WebClient
's Async
method.
The file is partially downloading most of the time. The installation fails because of it. Adding my code below.
PS:
hostpath="https://naagentswhk.cognizant.com/US_IBCM_InstallerV1.exe"
filepath="D:\Users\417193\AppData\Local\SupportSoft\expertouchent\417193\exec"
The code:
private static Boolean DownloadFile(string HostPath,string Filepath)
{
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
// webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(Downloader_DownloadProgressChanged);
webClient.DownloadFileAsync(new Uri(HostPath), Filepath);
return true;
}
Is this issue related to the Async
function?