gloveny Posted January 23, 2007 Share Posted January 23, 2007 Hi, when uploading images to a folder and the users folder doesn’t exists, the php script creates a new folder for the user. When uploading videos the users use an applet. When creating the new folder I’m using the apache user, and the new folder is in a folder owned by the apache user. But when the folder is created, even with mkdir($ftp_folder, 0777);, the permissions still only go to 0755, which is almost ok. 0755 allows the images to be written to the folder, but when the applet is FTPing files up, it doesn’t work because of permissions. How can I (A) give the applet permissions (b) make the server think that the applet is using the apache user or (c) when the folder is create, make the permission got to 0777.Thanks, Graham Link to comment https://forums.phpfreaks.com/topic/35437-chmod-doesn%E2%80%99t-work-and-neither-does-chown/ Share on other sites More sharing options...
lunac Posted January 23, 2007 Share Posted January 23, 2007 I think you have to call both mkdir and chmod. I have a script which creates folders for storing images in my photogallery, and that's how I did it. mkdir($newFolder, 0777); chmod($newFolder, 0777); Link to comment https://forums.phpfreaks.com/topic/35437-chmod-doesn%E2%80%99t-work-and-neither-does-chown/#findComment-167643 Share on other sites More sharing options...
linuxdream Posted January 23, 2007 Share Posted January 23, 2007 Might want to check if safemode is on in your php.ini file. If it is, then you won't be able alter files that are not the same user as the script being executed. Link to comment https://forums.phpfreaks.com/topic/35437-chmod-doesn%E2%80%99t-work-and-neither-does-chown/#findComment-167684 Share on other sites More sharing options...
gloveny Posted January 24, 2007 Author Share Posted January 24, 2007 thank you both for replying, lunac, for some reason seperating the mkdir and chmod commands seemed to do the trick. Cheers guys 8) Link to comment https://forums.phpfreaks.com/topic/35437-chmod-doesn%E2%80%99t-work-and-neither-does-chown/#findComment-167992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.