string filePath = "\\\\ipaddress\\c$\\Web\\Application\\Temp\\SleepAway.mp3"; var uri = new Uri(filePath); string filename = Path.GetFullPath(uri.LocalPath); HttpResponse response = HttpContext.Current.Response; response.Clear(); response.ClearContent(); response.ClearHeaders(); response.Buffer = false; WebClient wc = new WebClient(); response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", Path.GetFileName(filePath))); response.ContentType = "application/octet-stream"; byte[] data = wc.DownloadData(filePath); response.BinaryWrite(data); EndResponse();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)