c# - XML data sent to Chrome browser does not trigger file save dialog -
in our code, there option export metadata xml file. code below:
string xml = toxml(metadatas, files); context.response.addheader("content-type", "application/octet-stream"); context.response.addheader("content-disposition", "attachment; filename=video_metadata.xml;"); context.response.write(xml); context.response.flush(); context.response.end();
this works fine in firefox. click button , prompted save xml file. however, in chrome, there no save file prompt. using fiddler, can see xml data there in response, , has status code of 200. there no errors shown on web server, , client side shows no indication of error, either. doesn't recognize data sent save file.
any appreciated. on same web server, able export csv files headers such:
context.response.addheader("content-type", "application/vnd.ms-excel"); context.response.addheader("content-disposition", "attachment; filename=assetlist.csv;");
edit: tried both text/xml
, application/xml
, unfortunately neither solved problem.
i change content type "text/xml". "application/octet-stream", specifying binary file.. guess technically correct. files binary, in case.. want "text/xml".
Comments
Post a Comment