[eluser]An Phu[/eluser]
I'm using upload file library in CI to upload xls files but i can't use it . when i execute upload site it always say :"The filetype you are attempting to upload is not allowed."
This my code :
Code:
function do_upload()
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'xls';
$config['max_size'] = '4096';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->load->view('upload_success', $data);
}
}
and this is my define in mine file :
Code:
'xls' => array('application/excel', 'application/vnd.ms-excel', 'application/msexcel'),