Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The upload path does not appear to be valid”. Codeigniter file upload

        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'doc|docx';
        $config['max_size'] = '400';
        $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('upload_form', $error);
    }
    else
    {
        $data = array('upload_data' => $this->upload->data());

  $this->referral_model->postCVReferralInfo($m_id, $emp_id , $job_id, $name, $age , $gender,$country_id, $mobile, $email, $summary, $workExp, $education, $qualification, $offer, $sb_id);
    header('location:'.$this->config->base_url().'index.php/member/referSuccess');

    exit;



    } ` 

If I try to upload the doc file then I'm getting this error "The upload path does not appear to be valid". I replaced the path to absolute Path then also I am getting this error. please suggest me how I can resolve the issue.`

like image 725
Lalit Avatar asked May 22 '13 11:05

Lalit


2 Answers

The problem usually occurs when a call to $this->load->library('upload', $config), may be it does not load the configuration settings, so try adding the following statement after loading the upload library.

$this->upload->initialize($config);
like image 130
Priya Jayapal Avatar answered Jun 23 '23 03:06

Priya Jayapal


Same problem...solved by

$this->upload->initialize($config);

And better not to use....BASE_URL in $CONFIG['UPLOAD_PATH']

like image 41
Uday Laddu Avatar answered Jun 23 '23 03:06

Uday Laddu