CodeIgniter Forums
getting error : The upload path does not appear to be valid. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: getting error : The upload path does not appear to be valid. (/showthread.php?tid=45449)



getting error : The upload path does not appear to be valid. - El Forum - 09-22-2011

[eluser]Unknown[/eluser]
I'm getting the The upload path does not appear to be valid. error while trying to implement below code.
My Controller code is:
Code:
$this->load->helper(array('form', 'url'));

        $this->load->library(array('form_validation','upload'));
        
            $config['upload_path'] = './photos/';
        $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())
        {
            $error = array('error' => $this->upload->display_errors());

            $this->load->view('addvideo', $error);
        }
        else
        {
            $data = array('upload_data' => $this->upload->data());

            $this->load->view('addvideo', $data);
        }

View code is :

Code:
<html>
<head>
<title>Upload Form</title>
</head>
<body>

<?php echo $error;?>

<?php echo form_open_multipart('homemanagement/uploadVideo');?>

<input type="file" name="userfile" size="20" />

<br /><br />

&lt;input type="submit" value="upload" /&gt;

&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;