public function upload(){
$upload = new \Think\Upload();// 实例化上传类
$upload->maxSize = 3*1024*1024 ;// 设置附件上传大小
$upload->allowExts = array('mp3','mp4','jpg','zip');// 设置附件上传类型
// $upload->exts = array('mp3','mp4');
$upload->rootPath = './Uploads/'; // 设置附件上传根目录
// 上传文件
print_r($_FILES);die();
$info = $upload->upload();
//ini_set('post_max_size', '2000M');
print_r($info);
if(!$info) {// 上传错误提示错误信息
$this->error($upload->getError());
}else{// 上传成功
$this->success('上传成功!');
}
}
php.ini :
post_max_size = ‘100M’
upload_max_filesize='100M'
httpd.conf :
php_value upload_max_filesize "80M"
php_value post_max_size "80M"