12345678910111213141516171819202122232425262728293031323334353637383940
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Downloading : System.Web.UI.Page { private string strFileSavePath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath; protected void Page_Load(object sender, EventArgs e) { string defaultFileRoot = @"C:\CCOM\"; string userRequest = Request.QueryString["URL"]; //string userRequest = "B"; if (!String.IsNullOrEmpty(userRequest)) { userRequest = "MEIScOMPONENT.zip"; //for debugging string filePlace = defaultFileRoot + userRequest; Response.ContentType = "application/save-as"; Response.AddHeader("content-disposition", "attachment; filename=" + userRequest); Response.WriteFile(filePlace); } else { } // Response.Write("You downloaded the file"); // Response.Flush(); } }