$this->uploads($picurl); public function uploads($picurl) { $config = array( 'maxSize' => 3145728, 'exts' => array('jpg','png','gif','jpeg'), 'rootPath' => './Public/', 'savePath' => 'Admin/img/', 'saveName' => '', 'autoSub' => true, 'subName' => array('date','Ymd'), ); $uploads = new ThinkUpload($config); $result = $uploads->uploadOne($picurl); //$result->$uploads->upload(); if(!$result) { $info = $uploads->getError(); } else { $info = __ROOT__.'/Public/'.$result['savepath'].$result['savename']; } return $info; } //调用upload上传文件有单文件上传跟多文件上传两种,但是将其封装成一个类传参数调用的时候,uploadOne($picurl)方法必须写传进来的参数,而upload()方法不能写传进来的参数,会显示非法上传文件!!! //返回信息使用uploadOne()方法不需要遍历,使用upload()方法必须遍历