私の Web アプリケーションでは、クライアントはサーバーからファイルをダウンロードできます。私のコードは次のようになります。
public void downloadFile(HttpServletResponse response, String fileName){
File fileToDownload = getFileWithName(fileName);
updateContentTypeAndLength(response);
OutputStream out = response.getOutputStream();
FileUtils.copyFile(fileToDownload, out);
}
クライアントがいつファイルのダウンロードを終了したかを知る必要があるのですが、それを知る方法はありますか? ありがとう。