I tried the same way what you have suggested. I took System.currentTimeMillis() as a Long type variable before the line FileInputStream fis = new FileInputStream( file ) and after the line sos.close(). It is showing the difference is 0.
I think sos.write( buff, 0, bytesRead ) is just writing the file content to the ServletOutputStream, i.e browser. However it won't be the actual download functionality. Once we click on the URL in a browser, downloading the file is browser specific and it would pop-up a download dialog window and start downloading from the source. I just wanted to capture exactly this downloading time.
Is it possible from the servlet? ...
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com