0

I'm trying to implement script that will allow a file to be uploaded, and then moved to a designated directory. This is running on a Windows server & IIS. I'm having 2 issues in doing so.

First, I get an error when trying to move the file.

Warning: move_uploaded_file(reports/ff.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\inetpub\wwwroot\betterinsight\betterinsight\upload_file.php on line 29

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\Windows\Temp\php1EAB.tmp' to 'reports/ff.jpg' in C:\inetpub\wwwroot\betterinsight\betterinsight\upload_file.php on line 29
Stored in: reports/ff.jpg

When searching, almost everything says it's a permission problem. I have added full rights (will pare down later) to the user: IIS_IUSRS. Even did it to the parent directory as one site recommended.

Second: As a possible solution to the above issue, I tried changing the directory in which files are saved. But the files are still uploaded into C:\windows\temp.
I've run phpinfo, and it says that uploads should be in (as defined by upload_tmp_dir):

Again, this is on a Windows Server 2008. Thanks.

4

2 回答 2

0
Permission denied

You need to set the folder permissions to 777 or enable read write to the folder. I think the permissions are messing...

于 2013-03-30T17:40:25.507 回答
0

OK, the answer was simple. I was adding permissions for user: IIS_USRS, when it should have been just user: USRS.

于 2013-03-31T06:26:49.740 回答