瀏覽代碼

修改获取文件

Yangzw 1 月之前
父節點
當前提交
f61f6c2a93

+ 1 - 1
feifan-framework/feifan-common/src/main/java/cn/newfeifan/mall/framework/common/util/servlet/ServletUtils.java

@@ -45,7 +45,7 @@ public class ServletUtils {
     public static void writeAttachment(HttpServletResponse response, String filename, byte[] content) throws IOException {
         // 设置 header 和 contentType
         if (filename.contains("mp4")) {
-            response.setHeader("Content-Disposition", "inline;");
+            response.setHeader("Content-Disposition", "inline;Accept-Ranges: bytes;Cache-Control: no-store;Pragma: no-cache");
             response.setContentType("video/mp4");
         } else {
             response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "UTF-8"));