Page 1 of 1

Getting move_uploaded_file to work

Posted: Sat Oct 18, 2003 7:07 am
by LonelyProgrammer
Hi all...

Whenever I try to use move_uploaded_file to move an uploaded file to a directory, it gives me this error:

Code: Select all

Moving file to C:\Inetpub\wwwroot\eknowledge\quizmedia\quiz10....
Warning: move_uploaded_file(C:\Inetpub\wwwroot\eknowledge\quizmedia\quiz10): failed to open stream: Permission denied in C:\Inetpub\wwwroot\eknowledge\quiz_manager.php on line 586
I made sure the directory exists (heck, I even create it if it doesn't!) but still can't get it to work. Any clue?

Thanks in advance.

Posted: Sat Oct 18, 2003 7:41 am
by Stoneguard
you have to make sure your IUSR_<compname>, which is your anonymous login id has create/write access to that directory. Which operating system is it? You need to go to that directory in a windows explorer, right click, select the security tab and add the IUSR access permissions.

Posted: Sat Oct 18, 2003 8:28 am
by LonelyProgrammer
Sorry for not being specific...

I am using Windows 98 as my developing platform and using Personal Web Manager. Do I have to add the upload directory as a virtual directory?

Posted: Sat Oct 18, 2003 8:42 am
by Stoneguard
I havent used win 98 in a long time. I am not sure ow security works under it, but you need the permissions set properly onthe directory you are writing to.

Posted: Sat Oct 18, 2003 10:03 am
by markl999
Might also be worth trying it without the c: bit, i.e just '\Inetpub\wwwroot\eknowledge\quizmedia\quiz10' as i;ve seen using drive/partition names cause problems before.

Most web servers allow you to use unix style paths too, so might also try using
'/Inetpub/wwwroot/eknowledge/quizmedia/quiz10' in both the uploaded paths.