473,498 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Response.header and response.contentType

Hi,

I am trying to set the content type and header for the response object
but for some reason it doesnt set it. I tried it on dev and it worked
fine but didnot on production. The difference is that dev is http and
production is https. Is there any difference in setting the header and
content type when doing so a http and when on a https server.

Thanks for your help
:)

Aug 17 '06 #1
8 4362

Katie wrote:
[stuff about HTTP headers and SSL]
I can't advise about this specific situation, but a great tool for
debugging stuff like this is Firefox with the Live HTTP Headers
extension installed.

http://livehttpheaders.mozdev.org/

Simply hit Alt+L and you'll get a sidebar that pops out. Then browse
the page that's causing trouble and you'll see all the request/response
activity.

Aug 17 '06 #2

"Katie" <Dn*********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Hi,

I am trying to set the content type and header for the response object
but for some reason it doesnt set it.
How did you discover that it doesn't set it?
>I tried it on dev and it worked
fine but didnot on production. The difference is that dev is http and
production is https. Is there any difference in setting the header and
content type when doing so a http and when on a https server.
There is no difference. https isn't really a different protocol it is http
over ssl where ssl is at a lower level than http. The http contents
including headers remain intact when sent over ssl.

I take it by Response.Header you meant Response.AddHeader?
>
Thanks for your help
:)

Aug 17 '06 #3
Yes it is response.addHeader i am trying to use

the code is

Response.AddHeader "content-disposition",
"attachment;filename="&originalFileName
Response.ContentType = contentType

the variable contentType and originalFileName are set to the correct
values, i verified that by printing them out. For some reason it takes
the content type as html no matter what and it gives some random text
for the filename

thanks
:)
Katie wrote:
Hi,

I am trying to set the content type and header for the response object
but for some reason it doesnt set it. I tried it on dev and it worked
fine but didnot on production. The difference is that dev is http and
production is https. Is there any difference in setting the header and
content type when doing so a http and when on a https server.

Thanks for your help
:)
Aug 17 '06 #4

Katie wrote:
For some reason it takes
the content type as html no matter what and it gives some random text
for the filename
Can you show us these values please?

Aug 17 '06 #5

"Katie" <Dn*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Yes it is response.addHeader i am trying to use

the code is

Response.AddHeader "content-disposition",
"attachment;filename="&originalFileName
Response.ContentType = contentType

the variable contentType and originalFileName are set to the correct
values, i verified that by printing them out. For some reason it takes
the content type as html no matter what and it gives some random text
for the filename
Printed out from where, how?

What I'm not yet convinced off is how you are seeing the headers aren't what
they should be at the client end?

Is Response.Buffer true or false?

thanks
:)
Katie wrote:
Hi,

I am trying to set the content type and header for the response object
but for some reason it doesnt set it. I tried it on dev and it worked
fine but didnot on production. The difference is that dev is http and
production is https. Is there any difference in setting the header and
content type when doing so a http and when on a https server.

Thanks for your help
:)

Aug 17 '06 #6
I am passing the content type and the originalfilename in the query
string to the page along with other info. It seems like it is taking
the entire querystring as teh filename and not using the
response.contentType = original filename

also response.clear doesnot seem to be working
are there any settings for response headers which may prevent pages
from modifying it>?

thanks
:)
Anthony Jones wrote:
"Katie" <Dn*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Yes it is response.addHeader i am trying to use

the code is

Response.AddHeader "content-disposition",
"attachment;filename="&originalFileName
Response.ContentType = contentType

the variable contentType and originalFileName are set to the correct
values, i verified that by printing them out. For some reason it takes
the content type as html no matter what and it gives some random text
for the filename

Printed out from where, how?

What I'm not yet convinced off is how you are seeing the headers aren't what
they should be at the client end?

Is Response.Buffer true or false?

thanks
:)
Katie wrote:
Hi,
>
I am trying to set the content type and header for the response object
but for some reason it doesnt set it. I tried it on dev and it worked
fine but didnot on production. The difference is that dev is http and
production is https. Is there any difference in setting the header and
content type when doing so a http and when on a https server.
>
Thanks for your help
:)
Aug 17 '06 #7
Katie wrote:
I am passing the content type and the originalfilename in
the query string to the page along with other info. It seems
like it is taking the entire querystring as teh filename and
not using the response.contentType = original filename

also response.clear doesnot seem to be working
are there any settings for response headers which may prevent
pages from modifying it>?
[blink]. Are you *absolutely* certain that Response.Clear() is not clearing
the header you set? You still have not shown any code, BTW.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Aug 17 '06 #8

"Katie" <Dn*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
I am passing the content type and the originalfilename in the query
string to the page along with other info. It seems like it is taking
the entire querystring as teh filename and not using the
response.contentType = original filename

also response.clear doesnot seem to be working
are there any settings for response headers which may prevent pages
from modifying it>?
I agree with Dave, I'm still struggling to imagine what you are actually
doing. A little bit of code would really help right now.

thanks
:)
Anthony Jones wrote:
"Katie" <Dn*********@gmail.comwrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Yes it is response.addHeader i am trying to use
>
the code is
>
Response.AddHeader "content-disposition",
"attachment;filename="&originalFileName
Response.ContentType = contentType
>
the variable contentType and originalFileName are set to the correct
values, i verified that by printing them out. For some reason it takes
the content type as html no matter what and it gives some random text
for the filename
>
Printed out from where, how?

What I'm not yet convinced off is how you are seeing the headers aren't
what
they should be at the client end?

Is Response.Buffer true or false?

thanks
:)
Katie wrote:
Hi,

I am trying to set the content type and header for the response
object
but for some reason it doesnt set it. I tried it on dev and it
worked
fine but didnot on production. The difference is that dev is http
and
production is https. Is there any difference in setting the header
and
content type when doing so a http and when on a https server.

Thanks for your help
:)
>

Aug 17 '06 #9

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

Similar topics

1
2747
by: Alex Nitulescu | last post by:
Hi. I have a WebService which provides a webmethod which returns a byte array representing a picture. The method's signature is: <WebMethod(Description:="Shows something nice every time !")>...
3
7522
by: jeffpriz | last post by:
I'm have a situation where I need to put a download link/button on a page, where the file to be downloaded does not exist on our webservers .... So I'm using Response.WriteFile (i've also tried...
8
2753
by: Mantorok | last post by:
Hi all I have the contents of a text file that I would like to output to the response stream, however IE thinks it is XML and comes up with and error, here is the code: Response.ContentType =...
6
7312
by: john | last post by:
The standard method to transmit a file from an aspx page to a browser is to stream the file to the response then end the response. The HTML code generated by the aspx page is discarded, and the...
7
10467
by: eventuranza | last post by:
For my application, there users can upload and download files to the a webserver. Straightforward enough. However, when they upload a PDF file then try to download it, the file seems to be...
1
4192
by: mattridings | last post by:
Hi gang, Have a script that works fine. However, it's really cpu intensive and I'm looking for suggestions on a) whether or not that's normal and if so b)a better way of doing it. Script is...
4
61748
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. ...
2
3168
by: Michael D. Ober | last post by:
When I single step through the code below, it sends back the PDF file that is retrieved in the line fm.GetAccountPDF(...). When I run without single stepping, I get the master page for this page. ...
2
2009
by: Nathan Sokalski | last post by:
I have an application in which I want to allow users to view certain files that are on the server, but not part of the application. To do this, I figured I would have ASP.NET read the files and...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
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...
1
6891
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...
0
7381
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...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
293
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...

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.