时间:2021-07-01 10:21:17 帮助过:10人阅读
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);die;
$this->data['thumb']=$file[0]['path'];
}
return $this->add();
}
}