mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
fix 修复 文件下载 设置content-length无效问题
This commit is contained in:
@ -178,8 +178,7 @@ public class SysOssServiceImpl implements ISysOssService, OssService {
|
||||
FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName());
|
||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
|
||||
OssClient storage = OssFactory.instance(sysOss.getService());
|
||||
long contentLength = storage.download(sysOss.getFileName(), response.getOutputStream());
|
||||
response.setContentLengthLong(contentLength);
|
||||
storage.download(sysOss.getFileName(), response.getOutputStream(), response::setContentLengthLong);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user