CodeIgniter Forums
The filetype you are attempting to upload is not allowed for uploading .php and .htm - 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: The filetype you are attempting to upload is not allowed for uploading .php and .htm (/showthread.php?tid=51213)



The filetype you are attempting to upload is not allowed for uploading .php and .htm - El Forum - 04-24-2012

[eluser]Genuine Scope[/eluser]
mimes.php

Code:
'php' => 'application/x-httpd-php',
        'php'   =>      'text/html',
        'php4' => 'application/x-httpd-php',
        'php3' => 'application/x-httpd-php',
        'phtml' => 'application/x-httpd-php',
        'phps' => 'application/x-httpd-php-source',
        'php' =>      'text/php',
        'php' =>      'text/x-php',
        'php' =>      'application/php',
        'php' =>      'application/x-php',
        'html' => 'text/html',
        'htm' => 'text/html',
        'htm' => 'text/html',
        'shtml' => 'text/html',

in the controller allowed types were added as follows
Code:
$config['allowed_types'] = 'PHP|php|php4|php3|html|HTML|htm|HTM';

but cannot upload .php and .htm files



The filetype you are attempting to upload is not allowed for uploading .php and .htm - El Forum - 04-24-2012

[eluser]Aken[/eluser]
1) You're defining your mimes wrong. Multiple mime types for a single extension should be in an array. Just look at the original mimes.php file for an example.

2) It's possible that the mime type for the file is being adjusted or misinterpreted by your browser. You should double check what the mime type is that the class is receiving in case the issues still persist.