Jump to:

23453 Posts in 18904 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Permissions on Uploaded Files.

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1663 Views
  • Patrick Arlt
    Avatar
    Community Member
    15 Posts

    Permissions on Uploaded Files. Link to this post

    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...

  • BigChris
    Avatar
    Community Member
    63 Posts

    Re: Permissions on Uploaded Files. Link to this post

    Hi Patrick,

    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.

    Good luck
    Chris

  • Patrick Arlt
    Avatar
    Community Member
    15 Posts

    Re: Permissions on Uploaded Files. Link to this post

    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.

    1663 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.