1

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.

Noam
  • 3,049
  • 10
  • 34
  • 52

1 Answers1

0

if the method finished ,and don't have any error,you should know the client have finished the downloading file. or you can return a status to client.

Bigbang
  • 1
  • 2