Browse Source

图片转换成base64码进行显示

tags/v1.1.0
qiujinyang 2 years ago
parent
commit
30743ece1f
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ReportServiceImpl.java

+ 3
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ReportServiceImpl.java View File

@@ -513,11 +513,11 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp
response.setContentType("application/msword;charset=GBK");

OutputStream out;
//File files = new File(filePath);
File files = new File(filePath,"");

log.info("读出的文件文件地址为:{}",filePath);
InputStream inputStream = this.getClass().getResourceAsStream(filePath);
//FileInputStream inputStream = //new FileInputStream(files);
//InputStream inputStream = this.getClass().getResourceAsStream(filePath);
FileInputStream inputStream = new FileInputStream(files);
//3.通过response获取ServletOutputStream对象(out)
out = response.getOutputStream();
int b = 0;

Loading…
Cancel
Save