如题
使用ResponseEntity下载文件,返回类型为ResponseEntity<byte[]>,下载过程代码如下
String pathName = path + id + ".csv";
ResponseEntity<byte[]> responseEntity = ResponseEntity.ok()
.headers(headers)
.body(FileUtils.readFileToByteArray(new File(pathName)));
下载的文件与源文件相比变大了,内容也发生错误无法打开,md5也不同
