HTTP content-length header

A

Andy Fish

Hi,

I have noticed some strange behaviour of the content-length header in my
asp.net 1.1 application. In this case I am streaming a word document with
this code:

Response.AddHeader("Content-Length", "394893");
Response.ContentType = "application/msword";
Response.AddHeader("Content-Disposition", "attachment;
filename=sample.doc" );
CopyStream(inputStream,Response.OutputStream);

when I run the server code on win2003 (iis6), the browser never receives a
content-length header regardless of whether I specify one or not. (if I
change the header to x-content-length it gets through). If I request a
static file through IIS, the content-length header appears correctly.

When I run the server code on winxp (iis5), the browser always recieves a
content length header, even if I don't specify one in the asp code. If I
specify an incorrect length, the browser receives the incorrect value so I
know that my header is getting through.

I have disabled all other IIS filters, proxy servers, antivirus or other
software which might be interfering with it, so as far as I can tell, it is
either IIS itself or asp.net that is causing this behaviour.

Can anyone help out with what is happening here? I would really like to be
able to set content-length header when running on IIS6

TIA

Andy
 

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

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top