Welcome Guest, Not a member yet? Register   Sign In
Upload excel file
#1

[eluser]henrihnr[/eluser]
Dear CI users..

I need to upload an excel file, which is in 2003 or 2007 format..
with 2003 format it works fine but 2007 format always return error message 'The filetype you are attempting to upload is not allowed.'

here's the code
Code:
$config['upload_path'] = 'uploads/';
$config['allowed_types'] = 'xls|xlsx';
        
$this->load->library('upload', $config);
    
if ( ! $this->upload->do_upload())
{
   echo $this->upload->display_errors();
}

anyone help me, please..
#2

[eluser]Randy Casburn[/eluser]
Hi there henrihnr,

Please ensure the mimes.php file in the config directory contains the xlsx extension as well.

hope this helps,

Randy
#3

[eluser]henrihnr[/eluser]
nice..you help me out..

i add below code to mimes.php
Code:
'xlsx'    =>  array('application/x-msexcel','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')

thx randy
#4

[eluser]Randy Casburn[/eluser]
You are quite welcome. Glad to help.

Randy




Theme © iAndrew 2016 - Forum software by © MyBB