I have an xml file saved and this is what I want to do,
when some one click the link that contains an xml file, I want them to ask the question if they want to save or open the file.
I know there is a way to do this using http header to send and trick your brower into us开发者_如何学Going the application/octet-stream mime type, but I forgot how it was done. .. it gives me this error
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
XML document must have a top level element. Error processing resource 'file:///C:/Documents and
Try adding Content-Disposition header:
Content-Disposition: attachment; filename="yourfile.xml"
And of course, the XML Content-Type header also:
Content-type: text/xml
精彩评论