I am downloading an Infopath form as an xml string from IIS and want it to open in Infopath. I set the ContentType to "application/ms-infopath.xml" (not sure where I got that from).
On some machines it is fine, on others the xml opens in the browser, or in Visual Studio or some other xml editor, even though Infopath is present.
- Who keeps the list of valid content types? Is this a valid MIME type for Infopath?
- What does the OS or browser do with it? It would appear it is only looking for the file association and not doing anything with the MIME type.
- How can I force this XML to open in Infopath even if the user has some other application associated with .xml files?
Here is the code - dead simple:
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "application/ms-infopath.xml";
Response.AppendHeader("Content-disposition", "attachment; filename=" + Name);
Response.Write(InfopathDoc);