|
function upfiles() {//上传文件
$config['upload_path'] = './uploads/stu/';
$config['allowed_types'] = 'rar|jpg|gif';
$this->load->library('upload', $config);
if (!$this->upload->do_upload())
{//如果上传失败
$mydata['msg']=$this->upload->display_errors();
}
else
{//上传成功
$mydata['msg'] = "文件已上传成功";
}
$this->load->view('main_view', $mydata);
}
上面这段代码在上传jpg,gif文件的时候很正常,但是上传rar文件就会报错{你上传的文件不在允许之列},但我明明加上了rar啊 |
|