1

在我的 Web 应用程序中,客户端可以从服务器下载文件。我的代码看起来有点像这样:

public void downloadFile(HttpServletResponse response, String fileName){
       File fileToDownload = getFileWithName(fileName);
       updateContentTypeAndLength(response);
       OutputStream out = response.getOutputStream();
       FileUtils.copyFile(fileToDownload, out);
}

问题是我需要知道客户端何时完成下载文件,有没有办法让我知道?谢谢。

4

1 回答 1

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.

于 2013-12-25T03:01:29.707 回答