I'm using skipper to upload images and the images keep uploading as being owned by root, not the desired outcome. The sails app is in a sub-folder in user X's home directory, in which all files are owned by user X. I am running "sudo sails lift" to start the app, so maybe sudo has something to do with it.
Here's the code for the upload:
req.file('images').upload(function ( error, files ) {
if ( error ) {
return res.serverError( error );
}
return res.json({
message: files.length + ' file(s) uploaded successfully!',
files: files
});
});
How can I make sure the files are uploaded as user X?