请帮我!我想用codeigniter上传一个文件,但这会返回错误。这是上传者:
class Uploader extends CI_Model
{
function __construct()
{
parent::__construct();
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|exe|xls|doc|docx|xlsx|rar|zip';
$config['max_size'] = '8192'; // kbytes
$config['encrypt_name'] = TRUE;
$this->load->library( 'upload', $config );
$this->response = '';
$this->success = TRUE;
}
/**
* Triggers upload
* returns the file's details on success or false
*/
function upload( $field_name )
{
if ( !$this->upload->do_upload( $field_name ) )
{
$this->success = FALSE;
$this->response = $this->upload->display_errors();
return false;
}
else
{
$this->success = TRUE;
$this->response = $this->upload->data();
return $this->response['file_name'];
}
}
}
这是错误消息:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Downloads::$required_empty
Filename: core/Model.php
Line Number: 51
自动加载数据库配置已打开。请帮我。