• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The upload path does not appear to be valid ???????

#1
[eluser]Unknown[/eluser]
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
Code:
function do_upload()
{
  
if(is_dir('./uploads/'))
  {
  // echo "there is directory <br/>";
   chmod('./uploads/',0777);
  }
  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());
   print_r($error);
  }
  else
  {
   //echo "<br/>yesupload";
   $userfile=$this->$_FILES['userfile']['name'];;
   $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

$this->upload->initialize($config);

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

Please help me out of this. Thanks in advance


Messages In This Thread
The upload path does not appear to be valid ??????? - by El Forum - 09-05-2012, 02:30 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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