php - Why is the upload path not valid? (Codeigniter) -
i have controller method 'do_upload' should upload image /img instead i'm getting following error:
http://localhost/img/ the upload path not appear valid.
this method of upload class.
public function do_upload(){ $config['upload_path']= "http://localhost/img/"; $config['allowed_types']= 'gif|jpg|png'; $config['max_size']='100'; $config['max_width']='1024'; $config['max_height']='768'; $this->load->library('upload',$config); if(!$this->upload->do_upload()){ $errors=array('errors'=>$this->upload->display_errors()); echo $config['upload_path']; $this->load->view('error',$errors); } else{ $data=array('upload_data'=> $this->upload->data()); $this->load->view('admin/admin'); } } the file permissions set following (to test works!):
drwxrwxrwx
however, if direct browser http://localhost/img/ able view contents of directory don't think it's permission issue. there i'm doing wrong?
you cannot upload url. $config['upload_path'] must path filesystem location on server.
Comments
Post a Comment