Codeigniter allow .php file uploads -


i using codigniters built in file upload library, , want allow php files uploaded.

this facility available admin users behind secure login etc.

but reason, getting 'the filetype attempting upload not allowed' errors.

i have in controller:

$config['allowed_types'] = 'pdf|doc|docx|php'; 

and have line in config/mimes.php:

'php'   =>  'application/x-httpd-php', 

this actualy functionality works if try upload image file etc, working, not allowing .php files.

any ideas why doesnt work? missing something?

figured out!!

when looked @ posted data, mime type content-type: text/php

but corresponding mime type in mime.php was:

'php'   =>  'application/x-httpd-php', 

so changed to:

'php'   =>  array('application/x-httpd-php', 'text/php'), 

and worked.

hallelujah!!


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -