westair Posted December 12, 2009 Share Posted December 12, 2009 Hi can anyone help me? Is it possible manipulate or control file permissions when using fwrite? I have a secure sub-directory (basic authentication) within www root which uses a script utilising fwrite to write files to a non-secure sud-directory in the www root. Trouble is the files written to the non-secure directory take on the permissions of the secure directory hence they are not displayed or visible within the web site. Is there a way to only apply the permissions for the directory to which it is written. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/184872-help-with-fwrite-and-permissions-in-iis/ Share on other sites More sharing options...
RussellReal Posted December 12, 2009 Share Posted December 12, 2009 sorry if I don't follow, however, I'd suggest using chmod to change the permissions Quote Link to comment https://forums.phpfreaks.com/topic/184872-help-with-fwrite-and-permissions-in-iis/#findComment-975936 Share on other sites More sharing options...
westair Posted December 12, 2009 Author Share Posted December 12, 2009 Ok something to think about, just need to work out how to apply it to windows. Sorry for the poor explanation, however the files written by the php script using fwrite are written with the same security permissions applied as the secure directory (which has basic authentication applied so you must login to it) that contains the php script. The directory into which the files are written everybody has read permissions, hence the permissions the file is written with (or retained from the secure directory) make the file no longer accessable. Basic concept is this: login to secure page, browse for eg image.jpg (with full everybody read permissions) and upload. File is (uploaded) copied to a non secure directory, yet file is written with same additional limmited user read/write etc. permissions as if it were in the secure directory with no everybody read permissions. Don't know if that is any clearer? Same suggestion applies anybody? thanks again in advance Quote Link to comment https://forums.phpfreaks.com/topic/184872-help-with-fwrite-and-permissions-in-iis/#findComment-975966 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.