In my web application clients can download files from the server. My code looks a bit like this:
public void downloadFile(HttpServletResponse response, String fileName){
File fileToDownload = getFileWithName(fileName);
updateContentTypeAndLength(response);
OutputStream out = response.getOutputStream();
FileUtils.copyFile(fileToDownload, out);
}
The thing is I need to know when the client has finished downloading the file, is there a way for me to know that? Thanks.