CodeIgniter Forums
Can't upload .xls - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Can't upload .xls (/showthread.php?tid=27032)



Can't upload .xls - El Forum - 01-29-2010

[eluser]frist44[/eluser]
If I set

Code:
$config['allowed_types'] = 'doc'

I can upload a .doc file just fine. However, if I set

Code:
$config['allowed_types'] = 'xls';

and upload an .xls, I get an error saying "The filetype you are attempting to upload is not allowed."

Any ideas why .xls is behaving differently?


Can't upload .xls - El Forum - 01-30-2010

[eluser]WebsiteDuck[/eluser]
Maybe the file type is bad...are you sure its really an excel file? Or just a file with an xls extension?

The $_FILES['myfile']['type'] needs to match one of these: 'application/excel', 'application/vnd.ms-excel', 'application/msexcel'


Can't upload .xls - El Forum - 01-30-2010

[eluser]frist44[/eluser]
I tried all 3 mimes in the mimes.php file with no luck. The file is good. I'm trying to use a few different ones, all that were created with excel 2003.

any other ideas?


Can't upload .xls - El Forum - 01-30-2010

[eluser]frist44[/eluser]
I dug through the Upload.php file and found the is_allowed_filetype() function. I went through it and found that in firefox,

Code:
$this->file_type = unknown/data

In IE,

Code:
$this->file_type = application/vnd.ms-excel

which makes it work in IE.

Any idea why this might be different in FF????