473,586 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ContentType problem - downloading instead of displaying

I have an aspx page. If I set the Response.Conten tType =
"applicatio n/voicexml+xml" then when I load browse to the page it
downloads the file and opens .Net Studio to allow me to edit it. It
should just display in my browser (as it does if I don't set the
ContentType).

I have appropriate MIME types set up in IIS (.vxml -->
application/voicexml+xml).

What am I doing wrong here? And more important, how can I fix it?

TIA,
BG
Nov 18 '05 #1
8 2033
i think the problem is that the mime type is not associated with your
browser it is rather associated with your vs.net

try looking up the file types under folder options. remove the association
with vs.net and then try.

Hope this helps,

HD

"Bryan Glennon" <br***@bpgc.com > wrote in message
news:MP******** *************** *@msnews.micros oft.com...
I have an aspx page. If I set the Response.Conten tType =
"applicatio n/voicexml+xml" then when I load browse to the page it
downloads the file and opens .Net Studio to allow me to edit it. It
should just display in my browser (as it does if I don't set the
ContentType).

I have appropriate MIME types set up in IIS (.vxml -->
application/voicexml+xml).

What am I doing wrong here? And more important, how can I fix it?

TIA,
BG

Nov 18 '05 #2
I checked that. VXML is not associated with VS.NET...

In article <uQ************ **@TK2MSFTNGP12 .phx.gbl>,
he************@ CAPS.AND.DOTS.h otmail.com says...
i think the problem is that the mime type is not associated with your
browser it is rather associated with your vs.net

try looking up the file types under folder options. remove the association
with vs.net and then try.

Hope this helps,

HD

"Bryan Glennon" <br***@bpgc.com > wrote in message
news:MP******** *************** *@msnews.micros oft.com...
I have an aspx page. If I set the Response.Conten tType =
"applicatio n/voicexml+xml" then when I load browse to the page it
downloads the file and opens .Net Studio to allow me to edit it. It
should just display in my browser (as it does if I don't set the
ContentType).

I have appropriate MIME types set up in IIS (.vxml -->
application/voicexml+xml).

What am I doing wrong here? And more important, how can I fix it?

TIA,
BG


Nov 18 '05 #3
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(objec t sender, System.EventArg s 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.Append Header( "content-disposition","a ttachment; filename=" +
name );
Response.Conten tEncoding = System.Text.Enc oding.UTF8;
Response.Conten tType = "applicatio n/voicexml+xml";
Response.WriteF ile(Server.MapP ath(name));
Response.End();

}

In addition to setting the "Response.Conte ntType", you need also use the
"Response.Appen dHeader" or "Response.AddHe ader" 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/h...3.html#anchor2
I've tested the code on my side, when didn't add "Response.Appen dHeader(
"content-disposition","a ttachment; 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(wit h 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.)
Nov 18 '05 #4
Hi Bryan Glennon,
Have you had a chance to try my suggestion or is your problem resolved ?
Please let me know if you need any help.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #5
Steven -
I did try it, and it works as you describe, but I need the vxml to
open in IE, and I can't make that happen.

(Sorry for taking so long to get back to you, but I was out of town
for a while)

Thanks for the help,
Bryan

In article <dz************ **@cpmsftngxa07 .phx.gbl>, v-
sc****@online.m icrosoft.com says...
Hi Bryan Glennon,
Have you had a chance to try my suggestion or is your problem resolved ?
Please let me know if you need any help.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #6
Hi Bryan,

Thank you for the response. Based on your description in the last reply.
You'd like the VXML file to be displayed in IE, yes?
I think if you just want to display the vxml file in IE(without popup the
file download dialog) when the browser navigate to it, you can just set the
ContentType as "text/xml", then the vxml will be displayed in IE as a xml
document. For example:
Response.Conten tType = "text/xml";

However, if you do need to set the ContentType as
"applicatio n/voicexml+xml", then, this is a particular document type that
the IE doesn't support by default. So if the response returned such
ContentType, the client will search for the most proper tools to open it.
Such as VS.NET or other ones(of course, this can be specified in client),
but the server side can't specify how the document is opened in client.

If you have any questions on it, please feel free to let me know.
Happy New year!

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #7
Steven -
I'm not sure there is a way around this. The basic issue is that for
execution on our voice platform, they type should be set to
application/voicexml+xml. But when I'm debugging, I like to be able to
see the vxml in my browser rather than having to listen to it being
processed on the voice platform.

Thanks again for the help, and have a great new year.

-Bryan
In article <fu************ **@cpmsftngxa07 .phx.gbl>, v-
sc****@online.m icrosoft.com says...
Hi Bryan,

Thank you for the response. Based on your description in the last reply.
You'd like the VXML file to be displayed in IE, yes?
I think if you just want to display the vxml file in IE(without popup the
file download dialog) when the browser navigate to it, you can just set the
ContentType as "text/xml", then the vxml will be displayed in IE as a xml
document. For example:
Response.Conten tType = "text/xml";

However, if you do need to set the ContentType as
"applicatio n/voicexml+xml", then, this is a particular document type that
the IE doesn't support by default. So if the response returned such
ContentType, the client will search for the most proper tools to open it.
Such as VS.NET or other ones(of course, this can be specified in client),
but the server side can't specify how the document is opened in client.

If you have any questions on it, please feel free to let me know.
Happy New year!

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #8
Hi Bryan,

Thanks for your response. Yes, sometimes we need different display style in
debuging time and deplyment time. However, in our issue, since how the
document displayed in the browser depends on the ContentType, we'd have to
use different ContentType if at debug and deploy time if we want the
different style it shows. Maybe you can workaround this way if you think it
possbile. Any way, thanks again for your wish.

If you have any questions, please feel free to let me know. Have a greate
New year, too.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2120
by: Marc | last post by:
Hello, I have a page with lots of thumbnails of photos. I want the user to be able to dload a big version of the photo (also present on the server) by either 1) clicking on it (left mousebutton) and have a 'save as...' dialog or 2) right-clicking on it and have a 'save as...' dialog. But I don't want the the whole photo to dload to the...
3
3714
by: S.W. Rasmussen | last post by:
Handling file downloading with Randy Birch very nice code (http://vbnet.mvps.org/code/internet/ftpdofiledownload.htm) raises a second question: I my case, the user should not be allowed to change the save destination for the downloaded file. Does anyone know if it is possible to circumvent the save dialogbox, for example by hiding it, or by...
4
2157
by: Luke StClair | last post by:
Only marginally belonging in this newsgroup... but oh well. I've just started writing in python, and I want to make the files available on the web. So I did the standard <a href="mypath/myfile.py"> and not surprisingly, it displays like a webpage, but just the code. If I gzip it, and then link to the new file, it will download, but its so...
0
981
by: Eyal Zinder | last post by:
Hello to all.. I'm trying to format an excel page by creating html tables on the fly through Response.ContentType = "application/vnd.ms-excel" . I now produce reports in html format by processing xsl templates and datasets and I would like to re-use the same xsl templates to produce excel content and display it in the browser. Here is the...
2
15471
by: CVerma | last post by:
I'm using an html input control (System.web.UI.HTMLControls.HTMLInputFile) to upload files such as msword, excel, jpg, and pdf. I have the encType property set in the form: encType="multipart/form-data" <INPUT id="UploadFile" type="file" name="UploadFile" runat="server"> Private Sub btnUploadFile_Click(ByVal sender As System.Object,...
2
4007
by: Stephen Walch | last post by:
I have seen many examples on the web for downloading attachments ffrom ASP.NET forms using response.WriteBinary, but they all use hard-coded ContentTypes (for example, Response.ContentType = "application/pdf"). Is there a good way to "guess" the content type for arbritary file name? Every web server has a mapping from file extension to...
1
1927
by: sonic | last post by:
Hi, I am able to display my document with contenttype="applicaton/msword" this requires that the content be marked up in html style.. i wanted to also try displaying it as RTF, so i could use \rtf1 \par style formatting in it. however when i do contenttype applicaton/rtf and attempt to insert rtf markup, the browser/ word does not...
1
1934
by: gts | last post by:
Hello, I'm putting together a page with some links to videos. One link plays the video and the other is supposed to allow the user to download the file by forcing the "save as" box. For the download link I'm using Response.ContentType = "video/x-ms-wmv" Response.AddHeader "content-disposition","attachment; filename=Around the...
4
61811
by: Bjorn Sagbakken | last post by:
With ASP.NET 2.0 I'm trying to display the pdf file directly in the client browser, but I only get a download dialogue box. Downloading the file works fine, but I want to view the PDF directly. I get the same response with: Response.ContentType="Application/X-unknown" which is more understandable. The...
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.