Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

streamed zip

Thread view: 
Tore Halset - 31 May 2007 15:46 GMT
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.
Ingo R. Homann - 31 May 2007 16:38 GMT
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.
Tore Halset - 01 Jun 2007 10:28 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

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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.