tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philipp Leusmann" <philipp.leusm...@post.rwth-aachen.de>
Subject AW: Detecting a download
Date Thu, 10 Jul 2003 16:46:17 GMT
If you use a servlet to send the file to the user, you could do something
like this:
response.setContentType("binary/octet-stream");  //I don┬┤t know if the
content-type is correct
ServletOutputStream out = response.getOutputStream();
InputStream is = file.getInputStream();
int i;
while((i = is.read()) != -1)
	out.write(i);
out.close();
is.close();
//INSERT CODE TO WRITE TIMESTAMP INTO DB HERE

Greetings,
 Philipp

> -----Urspr├╝ngliche Nachricht-----
> Von: Jon Felmey [mailto:jjfelmey@hotmail.com]
> Gesendet: Donnerstag, 10. Juli 2003 18:33
> An: tomcat-user@jakarta.apache.org
> Betreff: Detecting a download
>
>
> Not sure if this is even possible or would be done in Tomcat, but
> is there
> anyway to track the progress of a download?  What I am looking to do is 2
> things.  Once a user has logged in using JDBC Realm, they would
> download a
> file.  I want to archive that file, so that if there are problems
> I know the
> exact version of the file they downloaded.  I would also like to
> mark in the
> database the time/date that they finished downloading the file.
> Can this be
> done?  Any help would be greatly appreciated!
>
> _________________________________________________________________
> Tired of spam? Get advanced junk mail protection with MSN 8.
> http://join.msn.com/?page=features/junkmail
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message