i load the upload library in my Upload-Controller in the do_upload function:
public function do_upload() {
$upload_path_url = base_url() . 'uploads/';
$config['upload_path'] = FCPATH . 'uploads/';
$config['allowed_types'] = 'jpg|jpeg|png|gif';
$config['max_size'] = '30000';
// Here i loaded the library
$this->load->library('upload', $config);
// Here is the undefined $upload variable
if (!$this->upload->do_upload()) {
// code
}
// code
}
i get this error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Upload::$upload
Filename: controllers/Upload.php
Line Number: 24
Backtrace:
File: /var/www/application/controllers/Upload.php
Line: 24
Function: _exception_handler
File: /var/www/index.php
Line: 274
Function: require_once
how i can solve the problem?