How to get thinkphp3.2.3 upload file path

Source: Internet
Author: User

thinkphp3.2.3 upload file How to get the path:

First on the code

  Import Excel public     function upload () {       $upload = new \think\upload ();//Instantiate upload class       $upload->maxsize   =     3145728;//Set attachment upload size       $upload->exts      =     Array (' xlsx ', ' xls ');//Set attachment upload type       $upload, RootPath  =      './uploads/';//Set attachment upload root directory       $upload->savepath  =      ';//Set Attachments upload (sub) directory       // Upload file       $info   =   $upload->upload ();       if (! $info) {//Upload error message           $this->error ($upload->geterror ());       } else{//upload successfully Gets the upload file information           foreach ($info as $file) {               $FilePath = $file [' Savepath ']. $file [' Savename '];           }           Dump ($FilePath);       }     }

Page output Content
String ("57a9841cc3208.xls")
Just the file name.

I want to get the path of this file as

Orz, who's going to teach me?

Reply content:

$upload->savepath or $upload->rootpath

The above is thinkphp3.2.3 upload file How to get the contents of the path, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

Related articles:

How to get thinkphp3.2.3 upload file path

Thinkphp3.2.3 Integration Phpqrcode Sample code sharing for generation of QR codes

PHP Implementation page No refresh upload file

Asynchronous uploading of files using HTML5, support for cross-domain, with upload progress bar

  • 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.