protected void btnDownloadWebConnector_Click(object sender, EventArgs e) { string filename = Server.MapPath(@"~/ZSLWebConnect/ZSLWebConnectorSetup.msi"); FileInfo fileToDownload = new FileInfo(filename); if (fileToDownload.Exists) { Response.ClearContent(); Response.AddHeader("Content-Disposition", "attachment; filename=" + fileToDownload.Name); Response.AddHeader("Content-Length", fileToDownload.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.TransmitFile(fileToDownload.FullName.ToString()); Response.End(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)