[eluser]Josh Kendall[/eluser]
I'm trying to upload a Excel file (.xls format) to my server through a form on my CI based web site. I keep getting a "The filetype you are attempting to upload is not allowed" error. I'm not sure why I'm getting this as I have xls as the only allowed_types and I even modified mimes.php to reflect the octet-stream issue that I found when I was searching for this issue.
Controller Function:
Code:
function upload(){
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'].'/uploads/excel/';
$config['allowed_types'] = 'xls';
$config['max_size'] = '10000';
$this->load->library('upload', $config);
if(!$this->upload->do_upload()){
echo $this->upload->display_errors();
preprint($this->upload->data());
preprint($_FILES);
} else {
redirect('../../../excel/import/users::'.$_FILES['userfile']['name']);
exit();
}
}
And here is the line in Mimes.php
Code:
'xls' => array('application/vnd.ms-excel', 'application/octet-stream', 'application/msexcel', 'application/excel'),
and still it doesn't work. Does anyone have any suggestions?