keeps21 Posted March 11, 2009 Share Posted March 11, 2009 I have a script containing the code below: mkdir('/images/galleries/folder', 0777) The problem is that the directory created has the permissions 700, rather than the intended 777, meaning that the dir cannot be written too. Any idea why this is happening? Thanks Quote Link to comment Share on other sites More sharing options...
premiso Posted March 11, 2009 Share Posted March 11, 2009 I take it that you are on Linux, but if on windows Note: mode is ignored on Windows. Alternatively you should be able to use chmod after the directory call to set the mode. Quote Link to comment Share on other sites More sharing options...
keeps21 Posted March 11, 2009 Author Share Posted March 11, 2009 Yep it's on linux. Because the mode is ignored on windows the folder can be written to. But on the live server, which is running linux, the permissions are 700 meaning it can't be written to by the image uploading script. Changed the code to the following and it's working as expected. mkdir(ABS_PATH.'/images/galleries/'.$dir, 0777); chmod(ABS_PATH.'/images/galleries/'.$dir, 0777); cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.