if($this->upload->do_upload()){
$data = array('upload_data' => $this->upload->data());
echo "
";print_r($data);
//$this->load->view('upload_success',$data);
} else {
$error = array('error' => $this->upload->display_errors());
echo "
";print_r($error);
//$this->load->view('file_view', $error);
}
The above code should be:
if($this->upload->do_upload('flyer')){
$data = array('upload_data' => $this->upload->data());
echo "
";print_r($data);
//$this->load->view('upload_success',$data);
} else {
$error = array('error' => $this->upload->display_errors());
echo "
";print_r($error);
//$this->load->view('file_view', $error);
}
Add the name of the file field in the do_upload function.