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