I'm trying to upload a file on CodeIgniter 2 but it fails. I tried a few different ways, actually CI is getting the file and trying to put it in destination folder but I think there is a problem with folder permissions. Because I can echo file name etc.
This is my model file's related part:
$config = array
(
'upload_path' => 'uploads/campaigns/data',
'allowed_types' => 'csv',
);
$this->upload->initialize($config);
$this->upload->do_upload('file');
$file = $this->upload->data();
$file_name = $file['file_name'];
if(!empty($file_name)) {
echo $file_name;
}
else {
echo $this->upload->display_errors();
}
With this code, I can see filename but file is not uploading. I only have root account on this server and all files created and owned by root. Folders have 777 permission. What should I try now?
Thank you!