DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Open Save Dialog Box To Download File
// Open save dialog box to download file
string attachment = "attachment; filename=" myfile.xml";
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("content-disposition", attachment);
HttpContext.Current.Response.ContentType = "text/xml";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default;
HttpContext.Current.Response.TransmitFile(Server.MapPath(filepath));
HttpContext.Current.Response.End();
<a href="http://www.java-forums.org/java-software/"><strong>Java Software</strong></a>





