473,549 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "applicatio n/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.Socket Exception: Connection reset
at
java.net.Socket OutputStream.so cketWrite(Socke tOutputStream.j ava:96)
at java.net.Socket OutputStream.wr ite(SocketOutpu tStream.java:13 6)
at
org.apache.cata lina.connector. ResponseBase.fl ushBuffer(Respo nseBase.java:67 5
)
at
org.apache.cata lina.connector. HttpResponseBas e.doFlushBuffer (HttpResponseBa s
e.java:795)
at
org.apache.cata lina.connector. HttpResponseBas e.flushBuffer(H ttpResponseBase .
java:785)
at
org.apache.cata lina.connector. ResponseBase.wr ite(ResponseBas e.java:648)
at
org.apache.cata lina.connector. ResponseStream. write(ResponseS tream.java:313)
at
org.apache.cata lina.connector. http.HttpRespon seStream.write( HttpResponseStr e
am.java:183)
at
java.util.zip.D eflaterOutputSt ream.deflate(De flaterOutputStr eam.java:156)
at
java.util.zip.D eflaterOutputSt ream.write(Defl aterOutputStrea m.java:114)
at java.util.zip.Z ipOutputStream. write(ZipOutput Stream.java:261 )
at dk.topix.pixdb. servlet.Tiffzip er.writeEntry(T iffziper.java:1 65)
the application is runing on a tomcat4.1/java1.4/linux box.

Any hints/ideas?

Jan Agermose
Jul 17 '05 #1
2 3020
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 "applicatio n/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.Socket Exception: Connection reset
at
java.net.Socket OutputStream.so cketWrite(Socke tOutputStream.j ava:96)
at java.net.Socket OutputStream.wr ite(SocketOutpu tStream.java:13 6)
at
org.apache.cata lina.connector. ResponseBase.fl ushBuffer(Respo nseBase.java:67 5
)
at
org.apache.cata lina.connector. HttpResponseBas e.doFlushBuffer (HttpResponseBa s
e.java:795)
at
org.apache.cata lina.connector. HttpResponseBas e.flushBuffer(H ttpResponseBase .
java:785)
at
org.apache.cata lina.connector. ResponseBase.wr ite(ResponseBas e.java:648)
at
org.apache.cata lina.connector. ResponseStream. write(ResponseS tream.java:313)
at
org.apache.cata lina.connector. http.HttpRespon seStream.write( HttpResponseStr e
am.java:183)
at
java.util.zip.D eflaterOutputSt ream.deflate(De flaterOutputStr eam.java:156)
at
java.util.zip.D eflaterOutputSt ream.write(Defl aterOutputStrea m.java:114)
at java.util.zip.Z ipOutputStream. write(ZipOutput Stream.java:261 )
at dk.topix.pixdb. servlet.Tiffzip er.writeEntry(T iffziper.java:1 65)
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.setContentT ype("applicatio n/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.co m...
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 "applicatio n/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.Socket Exception: Connection reset
at
java.net.Socket OutputStream.so cketWrite(Socke tOutputStream.j ava:96)
at java.net.Socket OutputStream.wr ite(SocketOutpu tStream.java:13 6) at
org.apache.cata lina.connector. ResponseBase.fl ushBuffer(Respo nseBase.java:67 5 )
at
org.apache.cata lina.connector. HttpResponseBas e.doFlushBuffer (HttpResponseBa s e.java:795)
at
org.apache.cata lina.connector. HttpResponseBas e.flushBuffer(H ttpResponseBase . java:785)
at
org.apache.cata lina.connector. ResponseBase.wr ite(ResponseBas e.java:648)
at
org.apache.cata lina.connector. ResponseStream. write(ResponseS tream.java:313) at
org.apache.cata lina.connector. http.HttpRespon seStream.write( HttpResponseStr e am.java:183)
at
java.util.zip.D eflaterOutputSt ream.deflate(De flaterOutputStr eam.java:156) at
java.util.zip.D eflaterOutputSt ream.write(Defl aterOutputStrea m.java:114)
at java.util.zip.Z ipOutputStream. write(ZipOutput Stream.java:261 )
at dk.topix.pixdb. servlet.Tiffzip er.writeEntry(T iffziper.java:1 65)

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
2897
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 'assigning the recordset data to the stream lrecordset.save lstream lStream.Position = 0
6
7346
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 written to the output stream. We are willing to pay $ to any expert (e.g. MVP) consultant who has to time to help us track down this problem. (we...
0
3097
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 and read the output for command1 the script works well, If I sent command1 , I send command2 and then I read output for command1 and command2 it...
3
6752
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 on the stream. What am I doing wrong? There is more code than this, but this is the problem code.
2
1470
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 null character in the middle of the output. I think it was a null character, Firefox displays it as a '?' and the W3C validator says it's a non-sgml...
8
3745
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 XmlDataSource object (CurrentXMLData): Stream newStream = myWebClient.OpenRead(myStringWebResource); TextReader newReader = new StreamReader(newStream);...
33
2023
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: // ... bool good() const; // next operation might succeed bool eof() const; // end of input seen
0
2048
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 boundary strings and save the JPG binary data into a file. The problem is, I cant save the data into a proper JPG file which I then open. This is my...
2
1942
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. I can read the information from the stream with no problem. However, the problem comes when there is nothing to read in the stream. The stream is...
27
3111
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 that's causing the problem. Here's how I wrote the program originally: #include <stdio.h> #include <string.h>
0
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.