I created a controller which handles file posts, moves uploaded files to a folder beside the index.php file (not in the application folder, because I want to reach the files directly through http).
The upload works perfectly on Windows based servers but not on Linux. PHP version is still the same on every server, and my local machine.
The code:
$config['upload_path'] = 'files/pictures/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '10240';
$config['encrypt_name'] = true;
$this->upload->initialize($config);
if ( ! $this->upload->do_upload('Filedata'))
{
//error handling
}
else
{
$data = array('upload_data' => $this->upload->data());
imageResize($data['upload_data']['full_path'],600);
}
As you can see it's nothing special, it's an ordinary image uploader based on CI. Why do I get an error on Linux?
I tried several ways with the upload path, but none of them work. Folder has chmod 777.
$config['upload_path'] = './files/pictures/';
$config['upload_path'] = './files/pictures';
$config['upload_path'] = 'files/pictures/';
$config['upload_path'] = 'files/pictures';
None of these work under Linux.