Tp5上传文件获取是一个对象,怎么获取下面的值

浏览:335 发布日期:2019/10/22 分类:求助交流
$file = request()->file('name');

// 移动到框架应用根目录/public/uploads/ 目录下
$info = $file->move(ROOT_PATH . 'public' . DS . 'uploads');
dump($info);die;打印出来是一个对象



object(think\File)#15 (13) {
["error":"think\File":private] => string(0) ""
["filename":protected] => string(82) "D:\phpStudy\WWW\exam1\public\uploads\20191022\62d11a2a79b01b71093585329761b899.xls"
["saveName":protected] => string(45) "20191022\62d11a2a79b01b71093585329761b899.xls"
["rule":protected] => string(4) "date"
["validate":protected] => array(0) {
}
["isTest":protected] => NULL
["info":protected] => array(5) {
["name"] => string(38) "学生表学生表_20191021_091053.xls"
["type"] => string(24) "application/vnd.ms-excel"
["tmp_name"] => string(45) "C:\Users\hasee\AppData\Local\Temp\php3D4C.tmp"
["error"] => int(0)
["size"] => int(30208)
}
["hash":protected] => array(0) {
}
["pathName":"SplFileInfo":private] => string(82) "D:\phpStudy\WWW\exam1\public\uploads\20191022\62d11a2a79b01b71093585329761b899.xls"
["fileName":"SplFileInfo":private] => string(36) "62d11a2a79b01b71093585329761b899.xls"
["openMode":"SplFileobject":private] => string(1) "r"
["delimiter":"SplFileobject":private] => string(1) ","
["enclosure":"SplFileobject":private] => string(1) """
}
最佳答案
评论( 相关
后面还有条评论,点击查看>>