We are getting an error
Error:
Error: The filetype you are attempting to upload is not allowed.
array(1) { ["csv"]=> array(5) { ["name"]=> string(18) "cod_sp_payment.csv" ["type"]=> string(24) "application/vnd.ms-excel" ["tmp_name"]=> string(24) "C:\xampp\tmp\php5910.tmp" ["error"]=> int(0) ["size"]=> int(155) } }
Controller Code:
$config['upload_path'] = './uploads/excel/';
$config['allowed_types'] = 'text/comma-separated-values|application/csv|application/excel|application/vnd.ms-excel|application/vnd.msexcel|text/anytext|text/plain|text/csv|csv';
$this->load->library('upload', $config);
if(! $this->upload->do_upload('csv')) {
$error = array('error' => $this->upload->display_errors());
// $this->load->view('upload_form', $error);
echo $this->upload->display_errors();
}
$upload_data = $this->upload->data();
exit();