Hello.
I have a servlet that streams a zip archive to the client. It uses
java.util.zip.ZipOutputStream & co. It does not set the content
length header as the size is not known before the zip is created.
When a windows user clicks on a link to this servlet, she can
choose between "open" and "save". Save works very well, but
"open" does not. Using "open" just show an empty zip archive.
Anyone else seen this? Any known workaround?
Regards,
- Tore.
Hi,
> I have a servlet that streams a zip archive to the client. It uses
> java.util.zip.ZipOutputStream & co. It does not set the content
[quoted text clipped - 5 lines]
>
> Anyone else seen this? Any known workaround?
I am not sure if this is really the problem, but some time ago, I
encountered a similar problem (or: "a different problem with a similar
effect"):
When "opening" some remote resource via IE, some IE versions seem do not
pass the 'response-stream' to the application, but rather pass the URL
of the 'resource' to the application which causes the application to
send a second request to the server. If the server is not able to handle
that, this will cause problems.
Ciao,
Ingo
Tore Halset - 31 May 2007 19:30 GMT
> When "opening" some remote resource via IE, some IE versions seem do not
> pass the 'response-stream' to the application, but rather pass the URL
> of the 'resource' to the application which causes the application to
> send a second request to the server. If the server is not able to handle
> that, this will cause problems.
Thanks for the tip. I do not think this is the issue as the dialog show
that several MBs are downloaded.
The same problem happens with both MS Compressed Folders and with
WinZip 8.0 (I do not have a newer version).
- Tore.
> I have a servlet that streams a zip archive to the client. It uses
> java.util.zip.ZipOutputStream & co. It does not set the content
> length header as the size is not known before the zip is created.
> When a windows user clicks on a link to this servlet, she can
> choose between "open" and "save". Save works very well, but
> "open" does not. Using "open" just show an empty zip archive.
Perhaps it is "Case 2" in this issue:
http://support.microsoft.com/?kbid=308090
Strange
- Tore.
Tore Halset - 01 Jun 2007 11:48 GMT
> > I have a servlet that streams a zip archive to the client. It uses
> > java.util.zip.ZipOutputStream & co. It does not set the content
> > length header as the size is not known before the zip is created.
> > When a windows user clicks on a link to this servlet, she can
> > choose between "open" and "save". Save works very well, but
> > "open" does not. Using "open" just show an empty zip archive.
> Perhaps it is "Case 2" in this issue:
> http://support.microsoft.com/?kbid=308090
This fixed the problem:
res.setHeader("Cache-Control",
"must-revalidate, post-check=0, pre-check=0");
- Tore.