I had seen many videos and took reference from CI user guide but became unable to find out error.When file is submitted from the form,it sends program flow the the uploadImage() method below.Please help me with the way. Thank you
My code:
public function uploadImage()
{
$config['upload_path'] = './files/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload');
$this->upload->initialize($config);
if(!$this->upload->do_upload())
{
$this->load->view('upload');
}
else
{
$this->upload->display_errors();
}
}