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.

2 Answers 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...

Sign up to request clarification or add additional context in comments.

1 Comment

777 would be Unix / Linux.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.