Welcome Guest, Not a member yet? Register   Sign In
all of a sudden, previously ok code now won't upload excel files (xls)
#1

[eluser]skattabrain[/eluser]
so this is making me crazy ... all of a sudden, Firefox 3.01 won't upload my excel file, i get the error ... "The filetype you are attempting to upload is not allowed."

IE 7 and Google Chrome ... have no issues ... and this was working last time I checked it a few weeks ago.

uploading an MS Excel 2003 file ... not an XLSX file.

here is my controller ... has firefox changed how it handles the XLS mime type?

Code:
function do_upload() {
        
        $d['titlebar'] = 'Upload XLS Spreadsheet';
        $d['h2'] = 'Upload Your XLS Phone Useage Spreadsheet';
        
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'xls';
        $config['max_size']    = '4096';
        
        $this->load->library('upload', $config);
    
        if ( ! $this->upload->do_upload())
        {
            $d['error'] = $this->upload->display_errors();
                    
            $this->load->view('skadmin/uploadform_page', $d);
        }    
        else
        {
            $result = $this->upload->data();
            redirect('upload/file/'.$result['file_name']);            
        }
    }
#2

[eluser]skattabrain[/eluser]
seems like a local firefox issue ... another machine doesn't ahve this issue ... but i'm still stumped. i run firefox in safemode ... same problem
#3

[eluser]mscahill[/eluser]
I've confirmed this behavior. IE is fine, Firefox 3 fails with message "The filetype you are attempting to upload is not allowed."
#4

[eluser]mscahill[/eluser]
I fixed it! FF3 sends MIME of 'application/msexcel' for XLS documents. I added this to the config/mimes.php file for the xls extension, and now it works.
#5

[eluser]mscahill[/eluser]
New firefox update, and now firefox sends 'application/download' for XLS files. If you have problems uploading XLS files on Firefox, try adding this MIME type to config/mimes.php for the xls extension.

I don't know why Firefox would send this MIME. It doesn't make a whole lot of sense...
#6

[eluser]Unknown[/eluser]
Recently, they FF 3 changed the MIME type again to: 'application/x-msexcel'. Next time this happens just add print_r($_FILES); on the upload to look up the new MIME type.
#7

[eluser]skattabrain[/eluser]
[quote author="zulfajuniadi" date="1237412681"]Recently, they FF 3 changed the MIME type again to: 'application/x-msexcel'. Next time this happens just add print_r($_FILES); on the upload to look up the new MIME type.[/quote]

Thanks for that zulfajuniadi ... i didn't even think of doing that (as i ran into this again today!) Smile




Theme © iAndrew 2016 - Forum software by © MyBB