Count no of bytes successfully received by client
Hi All,
I am usingServletOutputStream to send binary data to client.
My code is,
--
ServletOutputStream svrResposeStrm = response.getOutputStream();
File sourceFile = new File("c:/aa.jpg);
byte [] fileBytes= getBytesFromFile(sourceFile);
svrResposeStrm.write(fileBytes);
--
In the above code function getBytesFromFile read a file and store data in byte array.
Is is possible tocount number of bytes successfully received by client? This situation may occur when client starts downloading but due to network issue or user has cancelled downloading, file is not download completely.
My requirement is to track above situation.
I have also noticed an entry in Tomcat access log
"GET /spk/aa.zip HTTP/1.1" 200 70742
This appears when i download a file 'aa.zip' which are placed in context 'spk'. This entry shows bytes70742
transferred by this request
Thanks in advance.
Message was edited by:
abhishekpandey_y2k

