|
@@ -284,8 +284,15 @@ public class CompatibleOldFileServiceImpl implements CompatibleOldFileService {
|
|
|
IoUtil.writeUtf8(response.getOutputStream(),Boolean.FALSE,"File not existed");
|
|
|
return;
|
|
|
}
|
|
|
- // 3.下载文件
|
|
|
- IoUtil.copy(service.download(fileInfo.getFileBucket(),fileInfo.getFilePath()),response.getOutputStream());
|
|
|
+ // 3.通过文件流的方式下载文件
|
|
|
+ // IoUtil.copy(service.download(fileInfo.getFileBucket(),fileInfo.getFilePath()),response.getOutputStream());
|
|
|
+ // 4.2021年12月22日12:00:21,先申请下载地址,然后通过重定向的方式直接请求文件服务器进行下载
|
|
|
+ String fetchUrl = service.fetchUrl(fileInfo.getFileBucket(), fileInfo.getFilePath());
|
|
|
+ if (StrUtil.isBlank(fetchUrl)){
|
|
|
+ IoUtil.writeUtf8(response.getOutputStream(),Boolean.FALSE,"File not existed");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ response.sendRedirect(fetchUrl);
|
|
|
}
|
|
|
|
|
|
/***
|