qin 1 년 전
부모
커밋
a2f777ccaa
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/main/java/com/poteviohealth/cgp/statistics/utils/ExcelUtils2.java

+ 2 - 2
src/main/java/com/poteviohealth/cgp/statistics/utils/ExcelUtils2.java

@@ -43,10 +43,10 @@ public class ExcelUtils2 implements ResourceLoaderAware {
                                     HttpServletResponse resp) {
 
         Resource template = resourceLoader.getResource(templateLoacation);
-        resp.setHeader("Content-Type", "application/vnd.ms-excel; charset=utf-8");
+        resp.setHeader("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8");
         try {
             resp.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(filename, "UTF-8"));
-            logger.info("文件大小2:" + template.contentLength());
+            resp.setHeader("Content-Length", String.valueOf(template.contentLength()));
         } catch (Exception e) {
             throw new RuntimeException(e);
         }