I am using codeigniter and jQuery form plugin.
I am trying to upload a file but its not working with IE.
Please check my controller:
if($fileCount >0)
{
//there are some files
//configure upload
$config['upload_path'] = 'crm_data/crm_customer_data';
$config['allowed_types'] = 'zip|rar|doc|pdf|gif|jpg|jpeg|docx';
$config["max_size"] = 2048;
$config['encrypt_name'] = true;
//loading upload
$this->load->library("upload");
$this->upload->initialize($config);
if($this->upload->do_upload("attach"))
{
$l = $this->upload->data();
$logs["attachment"] = $l["file_name"];
}
else
{
//some errors on upload exit(json_encode(array("status"=>FALSE,"reason"=>$this->upload->display_errors())));
}
Here is the html
<input type="file" id="attach" name="attach" />
IT WORKS WELL IN OTHER BROWSERS except IE.
see the response.
var_dump($_FILES)
array
'attach' =>
array
'name' => string 'invoice_record_and_list.zip' (length=31)
'type' => string '' (length=0)
'tmp_name' => string 'C:\wamp\tmp\phpF467.tmp' (length=23)
'error' => int 0
'size' => int 1467474
IN IE i am getting the following errors .
The filetype you are attempting to upload is not allowed.
EDIT:
I noted something var_dump on IE gives me a "" for typebut in FF i got 'type' => string 'application/x-zip-compressed' (length=28)
This may help.
IE not sending your mime type for ‘zip’ (eg:
'type' => string).so just append an empty value with the file types like this in your config/memi.ph.
'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed',"")