$file = $_FILES['file']怎么文件上传到服务器?

$file = $_FILES['file'];
拿到了前端上传过来的视频文件,我直接返回显示下面的信息:
image.png
我直接在后台用new Upload($file);上传$file文件,提示

rgument 1 passed to app\common\library\Upload::__construct() must be an instance of think\file\UploadedFile or null, array given, called in E:\robot\app\admin\controller\robot\Record.php on line 98
阅读 1.7k
2 个回答

应该将.tmp临时文件保存并且重新命名为.mp4

Upload($file) $file的类型不对.

$file = \think\Request::find('file')试一下.

宣传栏