Page 1 of 1

PHP file upload permissions

Posted: Wed Apr 23, 2003 3:08 am
by herod1
Hi All

I am trying to upload a file to a local directory and I am getting permission errors. I am using a local server IIS 5 on my XP Pro box. It used to work but I deleted the directory and now I cannot get the permissions correct. They seem fine in IIS (read/write/execute) but I still get this error:

Warning: copy(members/manager.jpg) [function.copy]: failed to create stream: Permission denied in c:\inetpub\wwwroot\prgadvertise.php on line 213

I have tried everything I can think of and now I turn to you for help.

Thanks in advance.

Posted: Wed Apr 23, 2003 4:27 am
by oQEDo
Is the directory within one of your webs or is it a seperate windows directory?

If it is a seperate windows directory (ie. c:\uploads\) the easiest thing to do is go into IIS manager and make that directory a virtual web directory, this ensures that the IUSER account has all necessary permissions.

(Also make sure your code is correct as the same error occurs if you do not have the full path specified correctly in your code)

Posted: Wed Apr 23, 2003 6:27 am
by herod1
Thanks for the response. The directory is shared under inetpub\wwwroot

I have read through many of the other posts on various forums for people experiencing the same problems, and many mention the IUSR permissions but I cannot find anywhere on XP Pro where I can assign user this user permission to the directory.

I tried looking at Security and Sharing but there is nothing to do with users there :cry:

Posted: Wed Apr 23, 2003 6:57 am
by oQEDo
In XP pro there is a setting something like "Use Simple Folder Security", if this is set then you will not get the security tab when you right click a folder and choose properties.
Check this is not set (I think you will find it on windows explorer under tools - options)

Posted: Wed Apr 23, 2003 7:23 am
by herod1
Hi oQEDo

Thank you very much indeed! When you said that, it triggered something in my memory about having to do that before.

I changed the security settings, got access to the user accounts, changed the folder permissions to read/write/execute for the IUSER and it now works fine.

Can't thank you enough as I would have stressed out eventually.

Posted: Wed Apr 23, 2003 7:26 am
by oQEDo
No probs :lol: