>>> Connie Ho <[EMAIL PROTECTED]> 11-Jul-00 11:04:15 PM >>>
>Hi all,
>I'm writing a servlet for file uploading. I would like to
>know how I can keep track of the number of bytes it
>uploaded during the process?
There are 2 ways:
First way:
int InputStream.available()
This call returns an int of the number of bytes that are waiting to
be read. Since a TCP stream will be definition buffer the input of
your connection you may safely call this once you are about to parse
the stream which is the file.
2nd way:
Read the content-length of the header of the part of the request
which contains the file upload.
Nic Ferrier
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html