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
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