我正在使用 codeigniter 和 jQuery 表单插件。
我正在尝试上传文件,但它不适用于 IE。
请检查我的控制器:
    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())));
    }
这是html
<input type="file" id="attach" name="attach" />
它在除 IE 之外的其他浏览器中运行良好。
看到回复。
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
在 IE 中,我收到以下错误。
不允许您尝试上传的文件类型。
编辑:
我注意到 IE 上的 var_dump 给了我一个""fortype但在 FF 我得到了'type' => string 'application/x-zip-compressed' (length=28)