Response.header and response.contentType

K

Katie

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
:)
 
B

Bobbo

Katie said:
[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.
 
A

Anthony Jones

Katie said:
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?
 
K

Katie

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
:)
 
A

Anthony Jones

Katie said:
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?
 
B

Bobbo

Katie said:
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?
 
K

Katie

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
:)
 
D

Dave Anderson

Katie said:
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.
 
A

Anthony Jones

Katie said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,263
Messages
2,571,062
Members
48,769
Latest member
Clifft

Latest Threads

Top