Forráskód Böngészése

修改下载变更记录模板接口

fengyanjie 3 éve
szülő
commit
574de3c8df

+ 3 - 5
dmp-rwd-edit/src/main/java/com/persagy/dmp/rwd/edit/controller/DownloadController.java

@@ -49,11 +49,9 @@ public class DownloadController {
             String resultFileName = URLEncoder.encode(fileName, "UTF-8");
             resp.reset();// 清空输出流
             resp.setCharacterEncoding("UTF-8");
-//            resp.setHeader("Content-disposition", "attachment; filename=" + resultFileName);
-//            resp.setContentType("application/txt");
-            resp.setHeader("Content-Length", String.valueOf(resourceAsStream.available()));
-            resp.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
-            resp.setHeader("Content-disposition", "attachment;filename=" + fileName);
+            resp.setHeader("Content-disposition", "attachment; filename=" + resultFileName);
+            resp.setHeader("Connection", "close");
+            resp.setHeader("Content-Type", "application/octet-stream");
             out = resp.getOutputStream();
             int len;
             byte[] buffer = new byte[1024];