Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Mac/stream problem
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 16th August 21:27
jan agermose
External User
 
Posts: 1
Default Mac/stream problem



I have this webapplication, that lets You pick a list of pictures to
download. At the en you klik on a link that says download and this url is
mapped to a servlet. The servlet looks up the pictures you selected and
prepares to send the pictures as a zip fil to you. This is done by setting
the response content type to "application/zip" and wrapping the response
stream to a zipoutputstream and then writing entries to the zipoutputstream.

This works very good when ever the client browser is a windows/IE, but
whenever the browser reads mac/IE the download fails.

The top of the exception stacktrace:
java.net.SocketException: Connection reset
at
java.net.SocketOutputStream.socketWrite(SocketOutp utStream.java:96)
at java.net.SocketOutputStream.write(SocketOutputStre am.java:136)
at
org.apache.catalina.connector.ResponseBase.flushBu ffer(ResponseBase.java:675
)
at
org.apache.catalina.connector.HttpResponseBase.doF lushBuffer(HttpResponseBas
e.java:795)
at
org.apache.catalina.connector.HttpResponseBase.flu shBuffer(HttpResponseBase.
java:785)
at
org.apache.catalina.connector.ResponseBase.write(R esponseBase.java:648)
at
org.apache.catalina.connector.ResponseStream.write (ResponseStream.java:313)
at
org.apache.catalina.connector.http.HttpResponseStr eam.write(HttpResponseStre
am.java:183)
at
java.util.zip.DeflaterOutputStream.deflate(Deflate rOutputStream.java:156)
at
java.util.zip.DeflaterOutputStream.write(DeflaterO utputStream.java:114)
at java.util.zip.ZipOutputStream.write(ZipOutputStrea m.java:261)
at dk.topix.pixdb.servlet.Tiffziper.wri****try(Tiffzi per.java:165)


the application is runing on a tomcat4.1/java1.4/linux box.

Any hints/ideas?

Jan Agermose
  Reply With Quote


  sponsored links


2 27th August 19:13
missaka wijekoon
External User
 
Posts: 1
Default Mac/stream problem



It looks like your mac/IE client is closing the socket. Does it not
know how to handle application/zip? What does the client do? Perhaps
changing the Content-Disposition in the http header may help? How does
it work with Mozilla?

-Misk
  Reply With Quote
3 27th August 19:13
jan agermose
External User
 
Posts: 1
Default Mac/stream problem


I've had contact to 3 different macusers and the results are all different
(on different browsers and OS9/ OSX), ranging from not getting any data to
getting the 25Mb zip file and not being able to open it, and then also one
success....

I have no idea on what to do here... and im somewhat dependent on being able
to serve mac users as a lot of publishing/imageing is done on mac' :-|

On your hint I found this:

res.setContentType("application/x-download");
res.setHeader("Content-Disposition", "attachment; filename=" + filename);

I will give it a try...

jan
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666