private void DownloadFile(string url) { string fileLocationWhenDownloaded = Path.Combine("C:\\", Path.GetFileName(url)); byte [] downloadedBytes; WebClient webClient = new WebClient(); downloadedBytes = webClient.DownloadData(url); FileStream fs = new FileStream(fileLocationWhenDownloaded, FileMode.CreateNew); fs.Write(downloadedBytes, 0, downloadedBytes.Length); fs.Flush(); fs.Close(); }call it passing the url of the file to be downloaded:
DownloadFile("http://YourSite/YourFile.Zip");
HTH.