Welcome Guest, Not a member yet? Register   Sign In
Invalid file types (upload xls/xlsx)
#1

Sorry for my bad english, because I speak on other language.  Angel

I have a next problem:

1. On two computers installed the same server (denwer) with same versions.
2. I copied all folder with my project and his base from one computer to another.
3. My code contains validation of mime types of uploading files (I use upload library + form validation).

PHP Code:
$config['allowed_types'] = 'txt|csv|xlsx|xls';
$this->upload->initialize($config); 


And it works excellent  Blush  , but only on first computer  Confused . On another computer (where I copied my project), it not works also. Namely, .xlsx and .xls files do not pass the validation!  Huh  I get message "Invalid file type" !

In mimes.php there are .xlsx and .xls by default

PHP Code:
'xlsx'  =>      array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet''application/zip''application/vnd.ms-excel''application/msword''application/x-zip'),
'xls'   =>      array('application/vnd.ms-excel''application/msexcel''application/x-msexcel''application/x-ms-excel''application/x-excel''application/x-dos_ms_excel''application/xls''application/x-xls''application/excel''application/download''application/vnd.ms-office''application/msword'), 


I tried upload any xlsx/xls files in other scripts, that don't use Codeigniter, and there files upload success. So I think that webserver is not guilty.

I don't understand what should I do? Please Help!!!! Huh
Reply


Messages In This Thread
Invalid file types (upload xls/xlsx) - by razorg1991 - 12-28-2015, 06:49 AM
Invalid file types ( xls/xlsx) - by edwards142 - 01-17-2017, 03:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB