Browse Source

将获取文件的接口做额外的处理5

Yangzw 1 month ago
parent
commit
8c28f8121d

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

@@ -163,7 +163,7 @@ public class ServletUtils {
             boolean newFile = file.createNewFile();
             log.info("=====创建文件yse or no:{}",newFile);
         }
-        Files.write(Paths.get("data/file/videoTest.mp4"), content);
+//        Files.write(Paths.get(path), content);
         return file;
     }
 

+ 1 - 1
feifan-module-infra/feifan-module-infra-biz/src/main/java/cn/newfeifan/mall/module/infra/controller/admin/file/FileController.java

@@ -85,7 +85,7 @@ public class FileController {
         if (path.contains("mp4")) {
             String range = request.getHeader("Range");
             log.info("========Range:{}", range);
-            ServletUtils.transfer(content, range, response,path);
+            ServletUtils.transfer(content, range, response, "/data/file" + path);
         } else {
             log.info("===============开始获取文件");
             ServletUtils.writeAttachment(response, path, content, request);