• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
2 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.