Link to home
Start Free TrialLog in
Avatar of phpretard
phpretard

asked on

Why do I get this pernissions error?

I am trying to upload an image with php.

PART 1
move_uploaded_file(logos/signature.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in

PART 2
move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\php5A3.tmp'
<?php
 
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
  {
  if ($_FILES["file"]["error"] > 0)
    {
    echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
    }
    else
      {
      move_uploaded_file($_FILES["file"]["tmp_name"],
      "logos/" . $_FILES["file"]["name"]);
      echo "Stored in: " . "logos/" . $_FILES["file"]["name"];
      }
  }
else
  {
  echo "Invalid file";
  }
 
 
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of AsishRaj
AsishRaj
Flag of Fiji image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial