I'm doing a script that will upload an image and save the image path in the database. The only problem that I have is if a user doesn't upload an image I want to set a default image.

But in codeigniter when an image is not selected it automatically gives an error saying that the input file hasn't been selected.

**my controller**

```
  if ( !$this->upload->do_upload('image'))
     {
    $error = array('error' => $this->upload->display_errors());
    $this->load->view('upload_success', $error);

     }
    else {
        $image_data=array('image_info' => $this->upload->data('image')); 
        $image_path=$image_data['image_info']['full_path'];

        $data =array(
        'submitedby'=>$username,
        'city'=>$this->input->post('towncity'),
        'image' => $image_path

);  
   }

```

Can someone please suggest me how to set a default image if the user hasn't selected an image without displaying the default error?