文件下载中使用inputStream流获取文件大小
inputStream.available()获取的是文件的字节大小
InputStream inputStream = new FileInputStream(new File(path)); response.setHeader("Content-Length", String.valueOf(inputStream.available()));
inputStream.available()获取的是文件的字节大小
InputStream inputStream = new FileInputStream(new File(path)); response.setHeader("Content-Length", String.valueOf(inputStream.available()));