2

我想在 CodeIgniter 中多次上传 excel 文件,但没有成功

(您尝试上传的文件类型是不允许的。)

控制器编码:

                $this->load->library('upload');
                $this->load->helper('file');
                //$config['upload_path'] = XLS_PATH;
                $config['upload_path'] = './public/test/files/test/';
                $config['allowed_types'] = 'xls|xlsx';
                $config['max_size'] = 0;

                $this->upload->initialize($config);

                echo $this->upload->file_type;

                if (!$this->upload->do_upload('userfile'))
                {

                    echo $this->upload->display_errors();

                }
                else
                {
                      $this->upload->do_upload('userfile');

                }

意见:

<form method="post" enctype="multipart/form-data">
<input type="file" id="userfile" name="userfile"/>
<input type="submit" name="submit" id="sumit" value="Test" />
 </form>
4

1 回答 1

1

该库中有错误,也许会有所帮助

于 2012-11-08T09:01:12.197 回答