0

I am using this code to upload files to a windows server:

        // Move the file over.
        if (move_uploaded_file ($_FILES['upload']['tmp_name'], "uploads/{$_FILES['upload']['name']}")) {

The error log result says: move_uploaded_file(): Unable to move 'C:\Windows\Temp\phpF2C3.tmp' to 'C:\wwwroot\uploads/flag.png' in C:\CustomerData\webspaces\webspace_00254529\wwwroot\upload_image.php on line 35

I assume this is a path related error (the folders have full permissions) but I am unsure how to include the path code into the upload file. Any suggestions greatly appreciated

15
  • I remember seeing something similar to your question last week. I believe what was needed to be done was to use / in front of the upload folder. Thus, "/uploads/{$_FILES['upload']['name']}" give that a try. Plus permissions could also be a factor. Commented Aug 5, 2013 at 17:13
  • Thanks, tried that, also with back slash but no luck Commented Aug 5, 2013 at 17:40
  • Sometimes the error doesn't necessarily originate from the given/said line. Many or most of the times it's because of the line above it. What's on the line above line 35? Commented Aug 5, 2013 at 17:50
  • By the way, does the uploads folder exist? Commented Aug 5, 2013 at 17:59
  • Yes the "uploads" folder exists with read/write permissions. Commented Aug 5, 2013 at 18:01

0

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.