string filepath = Server.MapPath("~/Uploads/Sheet1.xlsx"); FileInfo myfile = new FileInfo(filepath); if (myfile.Exists) { // Clear the content of the response Response.ClearContent(); Response.AddHeader("Content-Disposition", "attachment; filename=" + myfile.Name); Response.AddHeader("Content-Length", myfile.Length.ToString()); Response.TransmitFile(myfile.FullName); Response.End();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)