|
...
|
...
|
@@ -82,7 +82,9 @@ class FileController |
|
|
|
}
|
|
|
|
$size = $info['size'];
|
|
|
|
// 设置Content-Type头部
|
|
|
|
if($info['type'] == 'mp4'){
|
|
|
|
$header['Content-Type'] = 'video/' . $info['type'];
|
|
|
|
}
|
|
|
|
// 设置Accept-Ranges头部
|
|
|
|
$header['Accept-Ranges'] = 'bytes';
|
|
|
|
// 检查是否有范围请求
|
|
...
|
...
|
@@ -285,9 +287,9 @@ class FileController |
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/26 16:28
|
|
|
|
*/
|
|
|
|
public function downLoad($hash){
|
|
|
|
public function downLoad(){
|
|
|
|
$file_model = new File();
|
|
|
|
$info = $file_model->read(['hash' => $hash]);
|
|
|
|
$info = $file_model->read(['hash' => $this->param['hash']]);
|
|
|
|
if ($info === false) {
|
|
|
|
$this->response('指定文件不存在!', Code::USER_ERROR);
|
|
|
|
}
|
...
|
...
|
|