正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
| @@ -98,7 +98,7 @@ class FileController | @@ -98,7 +98,7 @@ class FileController | ||
| 98 | $files = $this->request->file('file'); | 98 | $files = $this->request->file('file'); |
| 99 | 99 | ||
| 100 | if (empty($files)) { | 100 | if (empty($files)) { |
| 101 | - $this->response('没有上传的文件!', 400); | 101 | + $this->response('没有上传的文件!'); |
| 102 | } | 102 | } |
| 103 | $type = $this->request->post('type','single'); | 103 | $type = $this->request->post('type','single'); |
| 104 | $this->setUrl(); | 104 | $this->setUrl(); |
| @@ -107,6 +107,9 @@ class FileController | @@ -107,6 +107,9 @@ class FileController | ||
| 107 | } else { | 107 | } else { |
| 108 | $size = $files->getSize(); | 108 | $size = $files->getSize(); |
| 109 | $file_type = $files->getClientOriginalExtension(); | 109 | $file_type = $files->getClientOriginalExtension(); |
| 110 | + if($files->getClientMimeType() === 'video/mp4'){ | ||
| 111 | + $this->response('上传格式错误'); | ||
| 112 | + } | ||
| 110 | return $this->single($files,$size,$file_type); | 113 | return $this->single($files,$size,$file_type); |
| 111 | } | 114 | } |
| 112 | } | 115 | } |
-
请 注册 或 登录 后发表评论