소스 검색

图片转换成base64码进行显示

tags/v1.1.0
qiujinyang 2 년 전
부모
커밋
cac62b7027
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. +4
    -4
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ReportServiceImpl.java

+ 4
- 4
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ReportServiceImpl.java 파일 보기

@@ -505,13 +505,13 @@ public class ReportServiceImpl extends BaseServiceImpl<ReportMapper, Report> imp
//清空缓存
response.reset();
// 定义浏览器响应表头,并定义下载名
//String urlFileName = URLEncoder.encode("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc", "UTF-8");
String urlFileName =new String(("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc").getBytes(), StandardCharsets.UTF_8);
String urlFileName = URLEncoder.encode("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc", "UTF-8");
//String urlFileName =new String(("汤山林场无人机巡检报告【"+ reportInfoVO.getReportNo() + "】.doc").getBytes(), StandardCharsets.UTF_8);
response.setHeader("Content-Disposition", "attachment;filename=" + urlFileName);
response.setCharacterEncoding("utf-8");
//定义下载的类型
response.setContentType("application/msword;charset=GBK");
//response.setContentType("application/msword;charset=GBK");
response.setContentType("application/octet-stream; charset=GB2312");
OutputStream out;
File files = new File(filePath,"");


Loading…
취소
저장