RE: How to cancel download on the server side

2016-06-15 Thread Bill Miller
List Subject: AW: How to cancel download on the server side Hi > I believe that, while the HTTP specification supports what you want to do, > neither servers nor clients support it. For example, you can > use "trailers" (headers end the end of the response) to tell the clie

AW: AW: AW: AW: How to cancel download on the server side

2016-06-06 Thread Steffen Heil (Mailinglisten)
Hi > It is a dirty Tomcat specific trick that will only work as long as the code > is the way it is but if you throw a ClientAbortException wrapped > in a ServletException you shouldn't see that log message. Thanks a lot, this was just what I was looking for. Regards, Steffen

Re: AW: AW: AW: How to cancel download on the server side

2016-06-05 Thread Mark Thomas
On 03/06/2016 22:08, Steffen Heil (Mailinglisten) wrote: > Hi > > >> throw new ServletException(); > > That was the difference. I threw a IllegalStateException(), so tomcat sent > "0\r\n". > I changed my code to throw a ServletException() and now it works. > Thanks for that. > > > One very

AW: AW: AW: How to cancel download on the server side

2016-06-03 Thread Steffen Heil (Mailinglisten)
Hi > throw new ServletException(); That was the difference. I threw a IllegalStateException(), so tomcat sent "0\r\n". I changed my code to throw a ServletException() and now it works. Thanks for that. One very little thing left: Is there a way to suppress the logged exception: Jun 03, 2016

Re: AW: AW: How to cancel download on the server side

2016-06-03 Thread Mark Thomas
On 03/06/2016 15:14, Mark Thomas wrote: > On 01/06/2016 23:08, Steffen Heil (Mailinglisten) wrote: That's another story. I tried that. And the internet explorer as well as curl report an error, if the download stops without the ending 0\r\n. But I had to set "Connection:

Re: AW: AW: How to cancel download on the server side

2016-06-03 Thread Mark Thomas
On 01/06/2016 23:08, Steffen Heil (Mailinglisten) wrote: >>> That's another story. >>> I tried that. And the internet explorer as well as curl report an error, if >>> the download stops without the ending 0\r\n. >>> >>> But I had to set "Connection: close" and "Transfer-Encoding: chunked" >>>

Re: How to cancel download on the server side

2016-06-03 Thread Olaf Kock
Am 03.06.2016 um 15:51 schrieb Steffen Heil (Mailinglisten): > NO. We want to stream the results to the client... It usually is > several times bigger than the memory at hand. I can think of three options right now: * Know the content-length upfront (which you don't) - with that clients could

AW: AW: How to cancel download on the server side

2016-06-03 Thread Steffen Heil (Mailinglisten)
Hi > > Yes, we thought about that. However it still leaves the problem of a > > lot of storage on the server that is used for no reason and increasing > > the time to download the backup.. > So it's better to buffer the huge download in memory instead of on the disk? > Maybe I don't understand

Re: AW: How to cancel download on the server side

2016-06-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Steffen, On 6/1/16 5:14 PM, Steffen Heil (Mailinglisten) wrote: > Hi > > >> We had a similar problem. We just added a "preparation" step >> before the actual download. >> >> 1. User clicks on "request download" link 2. jQuery sends a >> request

AW: AW: How to cancel download on the server side

2016-06-01 Thread Steffen Heil (Mailinglisten)
> > That's another story. > > I tried that. And the internet explorer as well as curl report an error, if > > the download stops without the ending 0\r\n. > > > > But I had to set "Connection: close" and "Transfer-Encoding: chunked" > > myself and encode the chunk headers myself. > > If I leave

Re: AW: How to cancel download on the server side

2016-06-01 Thread Mark Thomas
On 01/06/2016 22:27, Steffen Heil (Mailinglisten) wrote: > Hi > > >> I believe that, while the HTTP specification supports what you want to do, >> neither servers nor clients support it. For example, you can >> use "trailers" (headers end the end of the response) to tell the client what >>

AW: How to cancel download on the server side

2016-06-01 Thread Steffen Heil (Mailinglisten)
Hi > I believe that, while the HTTP specification supports what you want to do, > neither servers nor clients support it. For example, you can > use "trailers" (headers end the end of the response) to tell the client what > happened, but I suspect that no client will actually read > them or

AW: How to cancel download on the server side

2016-06-01 Thread Steffen Heil (Mailinglisten)
Hi > We had a similar problem. We just added a "preparation" step before the > actual download. > > 1. User clicks on "request download" link 2. jQuery sends a request to > servlet and instructs it to prepare the download 3. Meanwhile > the request download link has been changed with

RE: How to cancel download on the server side

2016-05-30 Thread Sebastian Trost
sten) [mailto:li...@steffen-heil.de] Sent: Sunday, May 29, 2016 8:08 PM To: Tomcat Users List <users@tomcat.apache.org> Subject: How to cancel download on the server side Hi I am streaming a huge file from a servlet to the browser. It can easily be multiple gigabytes. Currently the data i

Re: How to cancel download on the server side

2016-05-29 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Steffen, On 5/29/16 2:08 PM, Steffen Heil (Mailinglisten) wrote: > I am streaming a huge file from a servlet to the browser. It can > easily be multiple gigabytes. > > Currently the data is prepared on the server, stored in a file and > then sent

How to cancel download on the server side

2016-05-29 Thread Steffen Heil (Mailinglisten)
Hi I am streaming a huge file from a servlet to the browser. It can easily be multiple gigabytes. Currently the data is prepared on the server, stored in a file and then sent to the client with a "Content-Disposition: attachment" header, so the browser handles it as a download. After the