Error when trying to upload image

I try to upload an image file .. when I select the image via the file input box, and submit the form ... there are error message saying that No file selected ... does anyone had face this problem before ... ?

did you match the file-input name in the form and the name you're searching in the controller ??? , cause CI comes with a default name , so you need to change it or user the default in the form

Do you mean $this->upload->do_upload('file_input_name') ? Yes I provide file input name ...

some of my code :
if($this->upload->do_upload('my_photo') == false){
  $upload_error = $this->upload->display_errors();
  $this->data['message'] = '<div class="error">'.strip_tags($upload_error).'</div>';
  $this->template->display('form/addproduct', $this->data);
  return false;
  $photo = $this->upload->data();
  $this->data['content'] = '<div class="success">'.$photo.'</div>';

$person['name']    = $this->input->post('name');
$person['address']= $this->input->post('address');
$person['phone']= $this->input->post('phone');

can you post your form ??? , and i'm not sure if you can ask for file-input in post, cause i know they are store in $_FILE array

heres the link to the original code ...

controller :
view : i store all the form view on folder views/form/

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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