I am using Silverstripe on my universities web-server for a class website and I have run into a small hitch.
Whenever I upload a file using the CMS the file is uploaded with read only permissions (600) which means that it will not display on pages, ect...
I have emailed the schools tech department about this and am waiting for a response and thought I would post here also.
The files will upload successfully to the server and the assets folder and all its sub-folders have 777 as there permissions.
Is this a Silverstripe issue or a server issue? I have read around these forums a little and some of the suggestions are to write a cron job that would change all the permissions in everything in the assets folder to 755 every so often or to decorate the File class to change the permissions after upload. Could anyone shed light on either of those methods and give me some link to relevant documentation ect...
The 600 file permission is to do with your web server, which I am going to assume is Apache. There are possibly 2 things at play here. First is the Apache directory that your file is uploaded to. I think what happens is your file is temporarily uploaded to the Apache directory for file uploads and is then moved by the Apache user to the assets folder of SilverStripe.
You will need to have the tech department look at the file permissions of the group for the Apache user, may be called nobody, and see what it is set to stamp files as the are uploaded.
The other thing to check is the file permissions of the Apache temp file uploaded folder.
It may be solved by setting the correct umask on apache.
Thanks for the reply Chris, that certainly helps narrow down the problem. Do you have any advice on a workaround for this, either a Cron job or modifying the File Class to fix the permissions after upload?
Something tells me the school is going to drag their feet on this and doing a work around would be faster.