Jump to:

3430 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » setFolderName creates 644 not 755 permission?

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

Page: 1
Go to End
Author Topic: 332 Views
  • pinkp
    Avatar
    Community Member
    168 Posts

    setFolderName creates 644 not 755 permission? Link to this post

    When using setFolderName like this:

    $fields->addFieldToTab('Root.ProjectImages', $thumbField = new UploadField('ProjectThumb','Main Thumbnail'));
    $thumbField->setFolderName('portfolio/project-images/'.$this->URLSegment);

    My uploads return a 403 error as the folder created only has 644 permissions and not 755. The upload works but just shows a question mark in the thumbnail box..
    I can manually change the permissions my self but this is not practical for other users etc.

    How can I fix this thanks?

  • kinglozzer
    Avatar
    Community Member
    138 Posts

    Re: setFolderName creates 644 not 755 permission? Link to this post

    As far as I'm aware the default is to create folders with 755 permissions:

    http://api.silverstripe.org/3.0/source-class-Filesystem.html#16-27

    Is this on your development server, or could it be an issue with the web host?

  • pinkp
    Avatar
    Community Member
    168 Posts

    Re: setFolderName creates 644 not 755 permission? Link to this post

    That's what I thought, and its not been an issue before. But after speaking to the host 123-reg (who are a terrible choice for SilverStripe but I had no choice) they say its nothing to do with them..
    I did look into setting a yaml file to force it to 755 but didn't work it out.

    Its on a live host so probably something to do with their settings.. It does not cause an issue on my developing server...

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