I have problem uploading the files, whenever i echo
$this->upload->display_errors();
this gives error The upload path does not appear to be valid.
my directory structure
- main
- CI_Installation
- uploads
- brochures
The test i m doing is in my local machine. In production server the two inside folders will be in root folder instead of main folder.
I want to upload files to the uploads folder, i.e. outside CI installation folder. I have tried setting path
./uploads/brochures/
../../uploads/brochures/ and every other possible path but still getting that error.
Edit
I know i have something wrong in path, folder permission would have yield another error. The error explicitly says The upload path does not appear to be valid.
Below is snippet of the code, posting whole controller is not feasible because it has several lines of code, which might be difficult to read.
$config['upload_path'] = './uploads/brochures/';
$config['allowed_types'] = 'gif|jpg|png|pdf|docx|doc';
$config['max_size'] = '10000';
$config["remove_spaces"]=TRUE;
$config['encrypt_name'] = TRUE;
$this->load->library('upload',$config);
$this->upload->initialize($config);
$uploaded = $this->upload->do_upload("b_path");
$data = array('upload_data' => $this->upload->data());
echo "ERRORS = ".$this->upload->display_errors();
Can anybody help me here?
Thanks
brochuresdirectory exist? I ask because you said "my directory structure is"... but then didn't include it.uploadsdirectory and it exists