作者 lyh

gx

@@ -75,6 +75,8 @@ class FileController @@ -75,6 +75,8 @@ class FileController
75 if (!is_file($path)) { 75 if (!is_file($path)) {
76 $this->response('指定文件已被系统删除!', Code::USER_ERROR); 76 $this->response('指定文件已被系统删除!', Code::USER_ERROR);
77 } 77 }
  78 + $size = $info['size'];
  79 + header("Content-Length: ".$size);
78 // 设置Content-Type头部 80 // 设置Content-Type头部
79 header("Content-Type: video/mp4"); 81 header("Content-Type: video/mp4");
80 // 发送完整文件 82 // 发送完整文件
@@ -119,7 +121,7 @@ class FileController @@ -119,7 +121,7 @@ class FileController
119 * @method :post 121 * @method :post
120 * @time :2023/6/17 16:32 122 * @time :2023/6/17 16:32
121 */ 123 */
122 - public function single($files,$size,$file_type){ 124 + public function single(&$files,$size,$file_type){
123 $hash = hash_file('md5', $files->getPathname()); 125 $hash = hash_file('md5', $files->getPathname());
124 //查看文件是否存在 126 //查看文件是否存在
125 $fileModel = new File(); 127 $fileModel = new File();