RE: A way to know if file download has ended

2006-06-06 Thread Bachler, Elisabeth (Elisabeth)
THanks for your answer... I will keep all you said in mind. You are
certainly right.

-Original Message-
From: Wade Chandler [mailto:[EMAIL PROTECTED]
Sent: lunes, 05 de junio de 2006 17:08
To: Tomcat Users List
Subject: Re: A way to know if file download has ended


--- Darryl Miles [EMAIL PROTECTED]
wrote:

 Bachler, Elisabeth (Elisabeth) wrote:
  Thank you to everyone. I will investigate further.
  Elisabeth
 
 Maybe this thread is related (excuse the horid
 apache web interface) :
 

http://mail-archives.apache.org/mod_mbox/tomcat-users/200604.mbox/%3c444FA1E
[EMAIL PROTECTED]
 
 
 Darryl
 
Just remember there are so many other issues.  I say
that not to be pessimistic, but to be realistic to
maybe keep you from spending too much time on it.  For
instance, when you download a file using Firefox,
firefox will be downloading the bytes from the server
even while you are deciding to cancel or save and will
be storing this information into another buffer.  This
is why when you finally hit save if the box has been
up a while you'll notice a jump in the downloaded
bytes then the status of the download speed jumps back
down to the real value.  I mention that because I
don't know how much you are wanting to rely on
successfully downloaded which you mentioned in your
first email.  The user might hit cancel even after the
file has technically been successfully downloaded even
if only to temp space they can't retrieve in any easy
manner.  

There is also the issue of HTTP proxies and caching
and read ahead, all of these things affect HTTP and
the ability to be able to tell what actually happened
at the byte level between the client and server. 
Also, even if the user closes the browser ... you can
still write to the servlet API output with no error
being raised.  This is also true in Microsoft ISAPI
dlls.  I don't even think if you got at the low level
where the server is if you could reliably do this
because of the proxies and caches I talked about. 
Your proxies and caches and even the users may not be
the only ones in the pipeline, so you always have to
keep that in mind.  

We had an issue one time where bytes were getting cut
out of an https connection, but not an http
connection, and later we found an ISP in between us
and a client had some software in between that was
dropping bytes out of https when too much information
passed through and we finally figured that out and
they fixed it, but not just the fact that they didn't
pass the information back wouldn't affect you, but
also the fact that the software in between could be
reading more bytes than you request at a time to help
speed up users of the ISPs connections over HTTP and
keep doing this even when the TCP connection is
severed.

Wade

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: A way to know if file download has ended

2006-06-05 Thread Nicolas Schwartz

 This is one of those issues that just can't be solved
 with simple HTTP and HTML.  There isn't a response
 sent to the server to tell it every single download
 was successful (or at least not sent back to the web
 application ... TCP makes sure the last bytes get to
 the other side successfully or an error occurs, but
 the applications on the server side can't tell this or
 at least I don't know how).  Then to make the
 situation more difficult there is no defined event for
 tying into the HTTP process for when a certain
 download has occurred successfully.  So, one has to
 use a download manager of some kind to more easily
 manage things like this.  This could be a signed java
 applet or shockwave file or a COM object (not cross
 platform so I wouldn't recommend that, but you might
 think it's ok if you force IE and windows).  One could
 more easily tell if an upload had finished because you
 at least have a defined form element you can access
 through DOM, get the name, and then monitor the upload
 progress.
 
 Wade
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Hi,

I agree with Wade about not knowing in Tomcat whether download succeeded or not.
I tried many code and discussed about it in the forum and came to the 
conclusion it is not possible.
(subject was Last Byte Detection, conclusion was: HTTP is not the good level 
to detect that.)

Good luck,
Nicolas

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: A way to know if file download has ended

2006-06-05 Thread Bachler, Elisabeth (Elisabeth)
Thank you to everyone. I will investigate further.
Elisabeth


-Original Message-
From: Nicolas Schwartz [mailto:[EMAIL PROTECTED]
Sent: lunes, 05 de junio de 2006 10:48
To: Tomcat Users List
Subject: Re: A way to know if file download has ended



 This is one of those issues that just can't be solved
 with simple HTTP and HTML.  There isn't a response
 sent to the server to tell it every single download
 was successful (or at least not sent back to the web
 application ... TCP makes sure the last bytes get to
 the other side successfully or an error occurs, but
 the applications on the server side can't tell this or
 at least I don't know how).  Then to make the
 situation more difficult there is no defined event for
 tying into the HTTP process for when a certain
 download has occurred successfully.  So, one has to
 use a download manager of some kind to more easily
 manage things like this.  This could be a signed java
 applet or shockwave file or a COM object (not cross
 platform so I wouldn't recommend that, but you might
 think it's ok if you force IE and windows).  One could
 more easily tell if an upload had finished because you
 at least have a defined form element you can access
 through DOM, get the name, and then monitor the upload
 progress.
 
 Wade
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Hi,

I agree with Wade about not knowing in Tomcat whether download succeeded or
not.
I tried many code and discussed about it in the forum and came to the
conclusion it is not possible.
(subject was Last Byte Detection, conclusion was: HTTP is not the good
level to detect that.)

Good luck,
Nicolas

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: A way to know if file download has ended

2006-06-05 Thread Darryl Miles

Bachler, Elisabeth (Elisabeth) wrote:

Thank you to everyone. I will investigate further.
Elisabeth


Maybe this thread is related (excuse the horid apache web interface) :

http://mail-archives.apache.org/mod_mbox/tomcat-users/200604.mbox/[EMAIL 
PROTECTED]


Darryl

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: A way to know if file download has ended

2006-06-05 Thread Bachler, Elisabeth (Elisabeth)
Thanks
Elisabeth


-Original Message-
From: Darryl Miles [mailto:[EMAIL PROTECTED]
Sent: lunes, 05 de junio de 2006 13:07
To: Tomcat Users List
Subject: Re: A way to know if file download has ended


Bachler, Elisabeth (Elisabeth) wrote:
 Thank you to everyone. I will investigate further.
 Elisabeth

Maybe this thread is related (excuse the horid apache web interface) :

http://mail-archives.apache.org/mod_mbox/tomcat-users/200604.mbox/%3c444FA1E
[EMAIL PROTECTED]


Darryl

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: A way to know if file download has ended

2006-06-05 Thread Wade Chandler
--- Darryl Miles [EMAIL PROTECTED]
wrote:

 Bachler, Elisabeth (Elisabeth) wrote:
  Thank you to everyone. I will investigate further.
  Elisabeth
 
 Maybe this thread is related (excuse the horid
 apache web interface) :
 

http://mail-archives.apache.org/mod_mbox/tomcat-users/200604.mbox/[EMAIL 
PROTECTED]
 
 
 Darryl
 
Just remember there are so many other issues.  I say
that not to be pessimistic, but to be realistic to
maybe keep you from spending too much time on it.  For
instance, when you download a file using Firefox,
firefox will be downloading the bytes from the server
even while you are deciding to cancel or save and will
be storing this information into another buffer.  This
is why when you finally hit save if the box has been
up a while you'll notice a jump in the downloaded
bytes then the status of the download speed jumps back
down to the real value.  I mention that because I
don't know how much you are wanting to rely on
successfully downloaded which you mentioned in your
first email.  The user might hit cancel even after the
file has technically been successfully downloaded even
if only to temp space they can't retrieve in any easy
manner.  

There is also the issue of HTTP proxies and caching
and read ahead, all of these things affect HTTP and
the ability to be able to tell what actually happened
at the byte level between the client and server. 
Also, even if the user closes the browser ... you can
still write to the servlet API output with no error
being raised.  This is also true in Microsoft ISAPI
dlls.  I don't even think if you got at the low level
where the server is if you could reliably do this
because of the proxies and caches I talked about. 
Your proxies and caches and even the users may not be
the only ones in the pipeline, so you always have to
keep that in mind.  

We had an issue one time where bytes were getting cut
out of an https connection, but not an http
connection, and later we found an ISP in between us
and a client had some software in between that was
dropping bytes out of https when too much information
passed through and we finally figured that out and
they fixed it, but not just the fact that they didn't
pass the information back wouldn't affect you, but
also the fact that the software in between could be
reading more bytes than you request at a time to help
speed up users of the ISPs connections over HTTP and
keep doing this even when the TCP connection is
severed.

Wade

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: A way to know if file download has ended

2006-06-04 Thread Wade Chandler
--- Guido Schoepp [EMAIL PROTECTED] wrote:

 Bachler, Elisabeth (Elisabeth) schrieb:
  I have an application that uses tomcat 5.0.19. At
 one point in my
  application, the user has the possibility to click
 on a certain link in
  order to download a file.
  Once the file is downloaded, I would like the
 application to go to a certain
  jsp page is there a way to configure tomcat to
 do such a thing? I mean,
  to redirect to a page only if the download has
 been successfully ended?
 
 Maybe this can work:
 Write a a servlet (or JSP) that delivers the file to
 your user, e.g.
 
 
 response.setContentType(application/octet-stream);
 //or whatever
  java.io.InputStream data =
  new java.io.FileInputStream(file.bin);
  byte[] buf = new byte[4 * 1024];
  int len;
  while ((len = data.read(buf, 0, buf.length)) !=
 -1) {
  sout.write(buf, 0, len);
  }
 
 After that you can forward to the desired page:
  RequestDispatcher dispatcher =
 
 getServletContext().getRequestDispatcher(fwd.jsp);
  dispatcher.forward(request, response);
 
 
 Guido

This is one of those issues that just can't be solved
with simple HTTP and HTML.  There isn't a response
sent to the server to tell it every single download
was successful (or at least not sent back to the web
application ... TCP makes sure the last bytes get to
the other side successfully or an error occurs, but
the applications on the server side can't tell this or
at least I don't know how).  Then to make the
situation more difficult there is no defined event for
tying into the HTTP process for when a certain
download has occurred successfully.  So, one has to
use a download manager of some kind to more easily
manage things like this.  This could be a signed java
applet or shockwave file or a COM object (not cross
platform so I wouldn't recommend that, but you might
think it's ok if you force IE and windows).  One could
more easily tell if an upload had finished because you
at least have a defined form element you can access
through DOM, get the name, and then monitor the upload
progress.

Wade

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: A way to know if file download has ended

2006-06-03 Thread Guido Schoepp

Bachler, Elisabeth (Elisabeth) schrieb:

I have an application that uses tomcat 5.0.19. At one point in my
application, the user has the possibility to click on a certain link in
order to download a file.
Once the file is downloaded, I would like the application to go to a certain
jsp page is there a way to configure tomcat to do such a thing? I mean,
to redirect to a page only if the download has been successfully ended?


Maybe this can work:
Write a a servlet (or JSP) that delivers the file to your user, e.g.

response.setContentType(application/octet-stream); //or whatever
java.io.InputStream data =
new java.io.FileInputStream(file.bin);
byte[] buf = new byte[4 * 1024];
int len;
while ((len = data.read(buf, 0, buf.length)) != -1) {
sout.write(buf, 0, len);
}

After that you can forward to the desired page:
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(fwd.jsp);
dispatcher.forward(request, response);


Guido

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



A way to know if file download has ended

2006-06-02 Thread Bachler, Elisabeth (Elisabeth)
Hello,

I have an application that uses tomcat 5.0.19. At one point in my
application, the user has the possibility to click on a certain link in
order to download a file.
Once the file is downloaded, I would like the application to go to a certain
jsp page is there a way to configure tomcat to do such a thing? I mean,
to redirect to a page only if the download has been successfully ended?

Thanks



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]