Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

Server File Permissions Problem for Assets Folder


Reply


2 Posts   2070 Views

Avatar
Viv

Community Member, 30 Posts

9 August 2010 at 3:44pm

Edited: 09/08/2010 3:44pm

(Using SS 2.4.1)
I'm using a shared hosting setup which has been working fine until some recent upgrades to SS 2.4.0 and 2.4.1.

When I'm using the Files & Images section everything appears to work fine. I can upload files such as images, create new folders, etc. However, the files that get uploaded end up with file permissions that prevent the end user from viewing them. For example, images are visible in the Files & Images section and when choosing to 'Add an Image' from the content editor but they are not visible in the TinyMCE editor or on the actual website page ('forbidden' when trying to specifically view them).

I use the Plesk control panel with my host, so can log in to this and manually reset the permission to something more appropriate. (Plesk uses a checkbox system that gives options for read, write, execute for the three groups: owner, group, others. I presume this is just a visual representation of chmod structure(?)). Once I have done this it's all good.

I have tried to ensure that all folders Assets and below have full permissions but the problem still keeps happening.

Called my hosting company and they said it would be an issue at the Silverstripe code end. There seems to be some configuration settings in Filesystem.php such as this:

public static $file_create_mask = 02775;
public static $folder_create_mask = 02775;

I'm assuming there is something in one of these files that I could alter? My skills with PHP are fairly basic, but if someone is able to point me in the right direction as to how I can get files to upload into the assets folder and it's sub folders with the proper permissions, I'd really appreciate it.

Avatar
Viv

Community Member, 30 Posts

9 August 2010 at 8:58pm

Seem to have SOLVED this one myself (hopefully not broken something else...).

Have used a patch here which was related to 2.4.0 but have used it with my 2.4.1 installation:

[url]http://open.silverstripe.org/attachment/ticket/5547/2.4.0-FileUpload.diff[/url]

I found via this post: [url]http://www.silverstripe.org/general-questions/show/281744#post281744[/url] which perhaps isn't quite related to the problem I had, but it seems to have fixed it.