Welcome Guest, Not a member yet? Register   Sign In
upload images file with rename extension

Dear all,

I am using below code. Then I have images file renamed from gif to bmp or jpg in extension. When I using below code to upload this image file, it will have issues as there is error. If I have not renamed the file extension, it is OK to upload images with correct extension.
I just think that if I rename files from image file extension to another image file extension can be OK. But if I rename bat or csv to images file extension, it is not OK and should not allow if I have configured the correct allowed file type. (not allow bat, csv.....).
Is it possible????

$config['file_name'] = basename($imgPath);
                $config['upload_path'] = $upload_dir;  
                $config['allowed_types'] = 'gif|jpg|png|bmp|jpeg';    // '*';
                if ( ! $this->upload->do_upload('image'))

You cannot change the file extension to a different format they are not compatible.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Theme © iAndrew 2016 - Forum software by © MyBB