The question of the upload class in TP
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);d ie;
$this->data[' thumb ']= $file [0][' path '];
}
return $this->add ();
}
}
This is the method I wrote in my model to add the article, call TP upload class can detect $_files data but returned $info nothing
Went to see the upload class inside return empty ($info)? False: $info; Supposedly, even if the error should return false but nothing is returned
Excuse me I use the wrong is the latest 3.2 tp frame .... Thank you first.
------Solution--------------------
Print_r ($upload); What can you see?