0

我想上传一个 ods 文件,但它显示错误:不允许您尝试上传的文件类型

$config['upload_path'] = './uploads/';
            $config['allowed_types'] = 'ods|csv|xls';
    //      $config['max_size'] = '';
            $config['max_width']  = '';
            $config['max_height']  = '';
            $this->load->library('upload', $config);

            if (!$this->upload->do_upload())
            {
                $error = array('error' => $this->upload->display_errors());

                $this->load->view('uploadstatement',$error);
            }

                    else
            {
    $data = array('upload_data' => $this->upload->data());
    $data1=$this->upload->data();
    $csv_file1=$data1['file_name'];
4

1 回答 1

0

added/replacedmime 类型文件的以下行application/config/mimes.php

'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
于 2015-08-26T04:55:21.157 回答