Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/184872-help-with-fwrite-and-permissions-in-iis/
Share on other sites

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  :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.