private void CreateLinkDownloadFile(string strLink) { // The file path to download. string filepath = strLink;//@"C:\shadow_copy.rar"; // The file name used to save the file to the client's system.. string filename = Path.GetFileName(filepath); try { System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.ClearContent(); response.Clear(); response.ContentType = "application/octet-stream"; response.AddHeader("Content-Disposition", "attachment; filename=" + filename + ";"); response.TransmitFile(filepath); response.Flush(); response.End(); } catch (Exception ex) { Response.Write(ex.Message); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)