The doubt of the upload class in TP

Source: Internet
Author: User
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?
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.