[eluser]Twisted1919[/eluser]
This code works:
Code:
$upload_path = FCPATH.'pub/avatars/'.$category_id.'/';
$config=array();
$config['upload_path'] = $upload_path;
$config['allowed_types'] = 'gif|jpg|png';
$config['encrypt_name'] = TRUE ;
$config['max_size'] = 0;
$config['max_width'] = 200;
$config['max_height'] = 200;
$this->load->library('upload');
$this->upload->initialize($config);
This doesn't, it gives "The upload path is not valid" error:
Code:
$upload_path = FCPATH.'pub/avatars/'.$category_id.'/';
$config=array();
$config['upload_path'] = $upload_path;
$config['allowed_types'] = 'gif|jpg|png';
$config['encrypt_name'] = TRUE ;
$config['max_size'] = 0;
$config['max_width'] = 200;
$config['max_height'] = 200;
$this->load->library('upload',$config);