[eluser]debasishdebs[/eluser]
I am using latest version of CI on both linux and windows machine.
When I try file uploading class, as part of debugging , it says:
“The upload path does not appear to be valid.”
I tried to make $config[‘upload_path’] a link and the dir exists.
Even i changed the permission of upload path to 777 from terminal still same problem.
Help?
I am making CMS for the group m working..
My upload function in controller.(returns : bool(false)
Code:
function do_upload()
{
$config['upload_path'] = '../../../images';
realpath($config['upload_path']);
var_dump(is_dir($config['upload_path']));
if(!is_writable($config['upload_path']))
echo "You cannot upload to the specified directory, please CHMOD it to 777.";
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '0';
$config['max_width'] = '0';
$config['max_height'] = '0';
$this->load->library('upload', $config);
$var = $this->upload->initialize($config);
echo "<a >".$config['upload_path']."</a>";
echo "Helllo";
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
$this->load->view('upload_success', $data);
}
}