codeigniter3 do_upload perfectly working in local machine but not in shared server

Codeigniter3 do_upload perfectly working in local machine but not in shared server.

The $error is showing

"The upload path does not appear to be valid."

but upload path is just ok with 777 permission.

what to do?

$config['upload_path'] = FCPATH.'/uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('document_files'))
{
  $error = array('error' => $this->upload->display_errors());
  echo "<pre>";
  print_r($error);
  die();
}
else
{
  $data = array('upload_data' => $this->upload->data());
  echo "<pre>";
  print_r($data);
  die();
}

Upvotes: 0

Views: 56

Answers (1)

Elena Vasilenko
Elena Vasilenko

Reputation: 236

Try without first slash:

FCPATH.'uploads/'

Upvotes: 1

Related Questions