php - Why is my upload path invalid? (Codeigniter-Library) -
i'm creating library part of project , 1 of methods wrapper upload helper.
the method:
public function upload(){ echo "doing upload"; $config['upload_path']= resource_path . "downloads"; $config['allowed_types']='pdf|doc'; $config['max_size']='10000'; //echo $config['upload_path']; $this->ci->load->library('upload',$config); if(!$this->ci->upload->do_upload()){ echo "couldn't upload"; echo $this->ci->upload->display_errors(); echo $config['upload_path']; } else{ echo "could upload"; } }
i've checked directory permissions of downloads folder , exists i'm getting following error: "the upload path not appear valid."
how resolve issue?
edit:: created symlink directory strucutre looks like:
www -> /home/user/dropbox/www/appname
note variables used:
$this->ci = &get_instance(); // defined in custom library class define('resource_path', apppath . 'views/resources/'); // defined in constants.php
figured out idiotic problem.
i autoloading library , how when trying initialize configuration $this->load->library('upload', $config); wouldn't so.
instead put config files in config/upload.php
the other method have been $this->upload->initialize($config);
Comments
Post a Comment