Ive created a Web App where it is possible to download an xml file from the server to the client. It works just fine except that the Save Dialog recognizes the file being dowloaded as of type .aspx and the name of the file as being the name of the page I'm on. The page is called Download.aspx and it contains a button that when clicked executes the following code:
//sends the content to the client
Response.ContentType = "text/xml;charset=utf-8";
Response.AppendHeader("Content-Disposition", "attachment, filename=questionnaire.xml");
The save dialog appears and says:
Type: ASP.NET Server Page, 1,16KB
If I download the file and open it it contains the correct Xml file content and nothing else, so it is working correctly. It just annoys me that it appears to the user that he is downloading the aspx site (and it shows up as such in windows explorer as well) rather than the xml file which is the actual content.
Does anyone know how I can get the save dialog to show the name and type of my xml file rather than the web page?
View Complete Post