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

TP里面的Upload类的疑点

WBOY
Release: 2016-06-13 11:54:18
Original
881 people have browsed it

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 />	}
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template