Home  >  Article  >  Backend Development  >  TP里面的Upload类的疑点

TP里面的Upload类的疑点

WBOY
WBOYOriginal
2016-06-13 11:54:18842browse

TP里面的Upload类的疑问

public function add_article(){<br />		if($this->create()){<br />			p($_POST);<br />			p($_FILES);<br />			if(!empty($_FILES['thumb']['name'])){<br />				$upload = new \Think\Upload();<br />				$upload->savePath  		= 		'./upload/article/';<br />				$upload->exts      		=     	array('jpg', 'gif', 'png', 'jpeg');<br />				$upload->maxSize   		= 		3145728;<br />				$info = $upload->upload();<br />				print_r($info);die;<br />				$this->data['thumb']=$file[0]['path'];<br />			}<br />			return $this->add();<br /><br />		}<br />	}

这是我写在我的模型里面的添加文章的方法,调用tp的上传类 能检测到$_FILES数据 可是返回的$info什么都没有 
去看了upload类 里面return empty($info) ? false : $info; 按说就算错误也应该返回false可是什么都没有返回
请问是我使用的不对吗  是最新的3.2的tp框架....先谢过
------解决方案--------------------
print_r($upload); 能看到什么?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn