HttpServletResponse response
File file = new File(filePath);
if (!file.exists()) {
throw new FileNotFoundException(filePath);
}
// 设置回显文件大小
response.setHeader("Accept-Ranges", "bytes");
response.setHeader("Content-Length", String.valueOf(file.length()));
回显