472,146 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

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 4265

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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Alex Nitulescu | last post: by
3 posts views Thread by jeffpriz | last post: by
8 posts views Thread by Mantorok | last post: by
6 posts views Thread by john | last post: by
4 posts views Thread by Bjorn Sagbakken | last post: by
2 posts views Thread by Nathan Sokalski | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

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.