Welcome Guest, Not a member yet? Register   Sign In
Upload .php file help
#1

[eluser]Justin Patel[/eluser]
Hello Friends,


Code:
$config['upload_path'] = './language/';
        $config['allowed_types'] = 'gif|jpg|png|php';
        $config['max_size']    = '15500';
        $config['max_width']  = '1024';
        $config['max_height']  = '768';                    
        $this->load->library('upload', $config);
        $upload =  $this->upload->do_upload();


When I try to upload .php file. It gives error like


Code:
Array ( [error] =>

The filetype you are attempting to upload is not allowed
)


But it works for the .gif images

Please Help me out




Best Regards Smile
#2

[eluser]xwero[/eluser]
You have to use native upload variables to find out what mime type the browser adds to upload your file
Code:
echo $_FILES['userfile']['type']
And add the mime type to the mimes.php file in the config directory for the php key.




Theme © iAndrew 2016 - Forum software by © MyBB