473,378 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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.writeEntry(Tiffzi per.java:165)
the application is runing on a tomcat4.1/java1.4/linux box.

Any hints/ideas?

Jan Agermose
Jul 17 '05 #1
2 3004
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

Jan Agermose wrote:
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.writeEntry(Tiffzi per.java:165)
the application is runing on a tomcat4.1/java1.4/linux box.

Any hints/ideas?

Jan Agermose


Jul 17 '05 #2
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

"Missaka Wijekoon" <mi**************@yahoo.com> wrote in message
news:3F**************@yahoo.com...
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

Jan Agermose wrote:
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.writeEntry(Tiffzi per.java:165)

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

Any hints/ideas?

Jan Agermose

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sandeep | last post by:
Hi all, I am new to the ADODB.Stream I am using following code lRecordset.Open "Select * from <some table-name>" 'this query return more than 1000 records dim lstream as new ADODB.stream...
6
by: Yechezkal Gutfreund | last post by:
I have been using the following code (successfully) to read Xml formated text packets from a TCP stream. The output from the server stream consists of a sequence of well formed Xml documents...
0
by: mario.lat_ | last post by:
Hallo to all, I have write a little script for connecting to cisco router BUT I have a problem: I have to send to router all the commands and then I have to read the output. If I send a command1...
3
by: Sir Psycho | last post by:
Hi, For some reason, when i step over this code, it returns the full byte stream im expecting from the server, however when I let it run with no intervention, it only seems to grab a small chunk...
2
by: Mike P2 | last post by:
I made a Stream-inheriting class that just removes the tabs (actually the 4 spaces VS prefers to use) from the beginning of lines and empty lines. At first I was having trouble with it adding a...
8
by: T Driver | last post by:
Anyone have any idea how I can do the following? I have a connection to an XML file on a site I do not control, getting a string representation of the xml data that I can then feed to my...
33
by: john | last post by:
I am reading TC++PL3 and in "21.3.3 Stream State", 4 member functions returning bool are mentioned: template <class Ch, class Tr= char_traits<Ch class basic_ios: public ios_base { public: //...
0
by: Iridium | last post by:
Greetings, I am trying to get a JPG Frame from a MJPG Stream. A MJPG is basically a stream of JPGs which are splitted by a special boundary string. So I tried to get the stream, split it by the...
2
by: =?Utf-8?B?VHJlY2l1cw==?= | last post by:
I've made a post last Friday in regards to this subject, but I'm still a little lost. I've a problem regarding reading a stream. I am connected to a port that sends information using a stream. ...
27
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
I have a fully-portable C program (or at least I think I do). It works fine on Windows, but malfunctions on Linux. I suspect that there's something I don't know about the standard input stream...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.