Welcome Guest, Not a member yet? Register   Sign In
do upload is accepting .zip files instead of giving error
#1

Hello To All,

I have specified jpg, jpeg, png in allowed_types in do_upload.
I tried to upload .rar, .zip files but instead of throwing an error it redirects to a blank page.
It must not allow and throw an error.

if(!empty($_FILES['img1']['name'])){
               $config['upload_path'] = 'uploads/images/';
               $config['allowed_types'] = 'jpg|jpeg|png|gif';
               $config['file_name'] = $_FILES['img1']['name'];
               
               //Load upload library and initialize configuration
               $this->load->library('upload',$config);
               $this->upload->initialize($config);
               
               if(!$this->upload->do_upload('img1")){
                   $error = array('error'=>$this->upload->display_errors());
                   $this->session->set_flashdata('error',$error['error']);
                   redirect( redirect('my_controller/profile');
               }
               else{
                    $img1 = $this->upload->data();
                   $timg1 = $img1['file_name'];

               }
           }


Thank you in advance....
Reply


Messages In This Thread
do upload is accepting .zip files instead of giving error - by niravt07 - 07-05-2018, 03:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB