'maxSize' => 100*1024*1024, //单位是b
'savePath' => './public/uploads/',
'saveName' => array('date','Y-m-d-H-i-s'),
'rootPath' => './',
'exts' => array('jpg', 'gif', 'png', 'jpeg'),
'autoSub' => true,
'subName' => array('date','Ymd'),
);
$upload = new \Think\Upload($config);
$info = $upload->upload('image');
if(!$info){
$this->error($upload->getError());
}else{
$this->success("上传成功!");
}
$info为空值,获取不到,upload()内不填则报文件不存在
最佳答案