Hi Bryan Glennon,
Thank you for using Microsoft Newsgroup service. Based on your description,
you have an aspx
page which is to show a VXML file for the user to download or open? Also,
you've add the the
mime type in the IIS. However, when you run the page and click the "open"
button on the downdload
dialog, you found that the vxml file was opened in the VS.NET rather than
the tool confitgured in
the Folder options? Please correct me if my understanding of your problem
is not quite accureate.
If my understanding is true, here is some suggestion:
In asp.net, if you want to show a certain type of data to the client and
want it to be display or downloaded,
you can use the following code:
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
string name = "VXML.vxml"; //VXML.vxml is a vxml file on the server
Response.Clear();
Response.AppendHeader( "content-disposition","attachment; filename=" +
name );
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.ContentType = "application/voicexml+xml";
Response.WriteFile(Server.MapPath(name));
Response.End();
}
In addition to setting the "Response.ContentType", you need also use the
"Response.AppendHeader" or "Response.AddHeader" to
add a header element into the response output stream. And the
"content-disposition" attribute will force the download dialog
to popup. Also, this header element will let the client side to choose the
proper tool to deal with the response output stream(doucment).
For more information about the "Content-Disposition" Header Field, you can
visit the following web link:
http://xml.resource.org/public/rfc/html/rfc2183.html#anchor2
I've tested the code on my side, when didn't add "Response.AppendHeader(
"content-disposition","attachment; filename=" + name )"
the vxml document did will be opended by the VS.NET. If add it, when load
the file in browser, the file will be opened by the tool you specified
in the Folder options's file association. If nothing is specified in the
client side 's file association(with the "vxml), there will popup the
dialog to let you choose a tool or webservice to open it.
Please try out the preceding suggestion to see whether it helps. Also if
you have any questions on it, please feel free to let me know.
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)