on 11-30-2007 2:59 AM
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.
HTTP standard chunked encoding
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is not a problem. I never know it is the chunked encoding of http protocol.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.