CodeIgniter Forums

Full Version: The upload path does not appear to be valid ???????
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi every one,
I am having this problem in uploading image and seriously making my hairs out. I have googled and gone thorough many forums but could not solved this out.

Here is the code for uploading image
function do_upload()
  // echo "there is directory <br/>";
  else echo "<br>there is no directory</br>";
  $config['upload_path'] ='./uploads/';
  $config['allowed_types'] = 'gif|jpg|png';
  $this->load->library('upload', $config);
  if (!$this->upload->do_upload())
  // echo "<br/>noupload<br/>";
   $error = array('error' => $this->upload->display_errors());
   //echo "<br/>yesupload";
   $data = array('upload_data' => $this->upload->data($userfile));
   $image_path = $data['upload_data']['file_name'];
   return $image_path;

But it shows the error The upload path does not appear to be valid. I have gone through the forums and it said to add


but whenever i add that code nothing happens even doesn't display any errors.

Please help me out of this. Thanks in advance