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....