您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
三六零分类信息网 > 荆门分类信息网,免费分类信息发布

TP里面的Upload类的疑点

2025/7/18 0:29:03发布16次查看
tp里面的upload类的疑问
public function add_article(){
if($this->create()){
p($_post);
p($_files);
if(!empty($_files['thumb']['name'])){
$upload = new \think\upload();
$upload->savepath = './upload/article/';
$upload->exts = array('jpg', 'gif', 'png', 'jpeg');
$upload->maxsize = 3145728;
$info = $upload->upload();
print_r($info);die;
$this->data['thumb']=$file[0]['path'];
}
return $this->add();
}
}
这是我写在我的模型里面的添加文章的方法,调用tp的上传类 能检测到$_files数据 可是返回的$info什么都没有 
去看了upload类 里面return empty($info) ? false : $info; 按说就算错误也应该返回false可是什么都没有返回
请问是我使用的不对吗  是最新的3.2的tp框架....先谢过
------解决方案--------------------
print_r($upload); 能看到什么?
荆门分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product