2

I would like to upload excel file many times in CodeIgniter, but not successfully

(The filetype you are attempting to upload is not allowed.)

Controller Coding:

                $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');

                }

Views:

<form method="post" enctype="multipart/form-data">
<input type="file" id="userfile" name="userfile"/>
<input type="submit" name="submit" id="sumit" value="Test" />
 </form>
3
  • what's the limit in your php.ini file? Commented Nov 8, 2012 at 8:42
  • upload_max_filesize = 2M Commented Nov 8, 2012 at 8:53
  • does your excel file size exceed 2M? Commented Nov 8, 2012 at 8:55

1 Answer 1

1

There is bug in that library maybe this will help

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.