cancel
Showing results for 
Search instead for 
Did you mean: 

Some extra bytes appended to the http response by GzipResponseStream

Former Member
0 Kudos

My project needs to open pdf in browser. But the IE tells me that the file cannot be open by default program. It is either corrupted or has a incorrect filetype. And IE tries to download it.

I trace the http response by HttpWatch and find the content type is "application/pdf" which seems correct. And then I notice that there are some extra bytes in the http resposne. I use a servlet to retrieve the pdf file. The last few bytes of the http response are "%%EOF\n\r\n0\r\n\r\n". The last seven bytes "\r\n0\r\n\r\n" are the extra ones. I suspect these bytes are added by GzipResponseStream according to my debug result. But I dont have the source code so I am not sure.

If I do not use servlet but get the pdf file directly the http response will end with "%%EOF\n" and IE can open it successfully.

And I checked all responses from servlet they all have the extra seven bytes. Sometimes it cause the IE crash.

I appreciate if anyone can tell me what the problem is.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HTTP standard chunked encoding

Former Member
0 Kudos

This is not a problem. I never know it is the chunked encoding of http protocol.