Forum Moderators: open

Message Too Old, No Replies

Windows Server Permission Problems

         

Ian Cunningham

10:37 am on Jan 27, 2005 (gmt 0)

10+ Year Member



I am currently using a php gallery script on my Windows 2003 Server. A user can upload a file to the gallery through a browse box, and this creates a thumbnail and uploads the actual file to a "files" directory.

For some reason, the thumbnail loads fine, but the actual image is not visible to the user and a password box pops up in IE when trying to view it.

I know that the image uploaded does not have the correct file permissions, so I connect to the windows server and allow any internet user to view the file. It works then...

However, I would have to do this everytime someone uploads a file! I have changed the parent directory to allow internet access to the files, but it just doesn't inherit these for some reason?

Any ideas on what I need to do?

duckhunter

1:58 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Set the permisssions at the folder level instead of the individual file.

Ian Cunningham

2:00 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



I did that, but the file doesn't seem to inherit the permissions :(

duckhunter

2:16 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



When you open the Sharing dialog box, under the Security Tab, what permissions does the local IIS account have? Make sure it has "List Folder Contents" & "Read".

Ian Cunningham

3:00 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



It has read, list and execute and some others ticked - it should be able to read from it according to the parent directory. Its just the file itself that has different permissions.

Hanu

5:20 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



My Windows Server version is in German but the method should be the same in the English version.

Right click the folder where the image is located. Select the Security tab. Set the necessary permissions. Click the Advanced button. The "Advanced Security Settings" dialog appears. At the bottom of the first tab you should see two checkboxes. Setting the second checkbox tells windows to enable inheritance of security setting on all files and subfolders of the current folder. This should also apply to files created subsequently. HTH

Ian Cunningham

5:48 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Thanks, I tried that but it only fixes images that are already uploaded. If I upload anything else after ticking the box it just doesn't work.

If I go to sharing properties on the newly created files they don't have the IUSR_ username associated with it at all?

Hanu

10:29 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Do you have Frontpage Extensions installed?

There is a "Don't Inherit Security Settings" option on the Server Extensions tab of root Web properties.

Ian Cunningham

10:58 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Nope, I dont have Frontpage Extensions installed either.

Is there any other reason they wouldn't inherit the correct permissions? I've tried a clean install of the script in a different directory and it does the same thing :(

Hanu

11:15 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



When you manually create a file in that directory, i.e. with Windows Explorer, does it inherit permissions? If not, you have a permission problem. If yes, something in IIS explicitly disables inheritance of security settings after a file is created.

Even if you don't have FP extensions installed, try to find the setting I described in my previous post.

Ian Cunningham

11:31 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



I tried to find that setting, but that tab just tells me to install server extensions if I want to use it.

If I create a new file the permissions are ok, even if I copy and paste the exact same file it still works fine!

Any other suggestions, as I'm really stuck :(