Fuel accessing server as 501:admin but files uploaded via model with www-data:www-data ownership...

edited March 2012 in Share
This problem has got me pretty stuck. I'm using the following code in the form_fields() function to save uploaded files to my assets directory:

$fields['gallery_image'] = array('label' => 'Gallery image', 'type' => 'file', 'upload_path' =>('assets/images/'), 'overwrite' => TRUE);

The assets/images folder has file ownership 501:admin. This appears to be the default ownership used by FuelCMS on my server. However, the file upload is given the ownership of www-data:www-data. This means that I can do no further processing of the image from inside fuel. Nor can I change its permission from inside of Fuel, since fuel doesn't own the file! As far as I can tell, the best bet is to allow 501:admin sudo access and then call sudo chown 501:admin filename.ext, which I suppose I could do via a helper.

However, I am also curious where the initial configuration of user:group is set in FuelCMS, why it is distinct from apache/php which run as www-data:www-data, and if it it possible to configure the default ownership of files uploaded to the assets directory to the same user:group that fuel uses.

Any elucidation here is greatly appreciated. I'll be sure to post my results upon success.


  • edited 11:36AM
    Hmm... I'm not sure what may be going on for you. FUEL doesn't do anything differently for file ownership. It uses the CI Upload class which simply uses the php user to write files.
Sign In or Register to comment.