修复上传到demo中的压缩文件及pdf预览异常

This commit is contained in:
陈精华
2020-08-11 10:42:01 +08:00
parent 40ac4b1eb9
commit fc73deb3fd
2 changed files with 25 additions and 17 deletions

View File

@@ -88,7 +88,8 @@ public class OnlinePreviewController {
public void getCorsFile(String urlPath, HttpServletResponse response) {
logger.info("下载跨域pdf文件url{}", urlPath);
try {
downloadUtils.saveToOutputStreamFromUrl(urlPath, response.getOutputStream());
byte[] bytes = downloadUtils.getBytesFromUrl(urlPath);
downloadUtils.saveBytesToOutStream(bytes, response.getOutputStream());
} catch (IOException e) {
logger.error("下载跨域pdf文件异常url{}", urlPath, e);
}