In a Web Application I am creating, users can backup their data locally. The backup data is an XML file. At the moment, most browsers try to display this file. What should I change in the HTTP response to suggest to a user-agent that the file should instead be saved?
+1
A:
You need a Content-Disposition header:
Content-Disposition: attachment; filename=my_backup.xml
Ned Batchelder
2009-08-26 15:40:46
A:
You need to use content disposition like:
AppendHeader("Content-Disposition", "filename=MyExportedFile.xml");
This will give you a save prompt rather than attempt to render to screen
Wolfwyrd
2009-08-26 15:43:36