Why do I get this pernissions error?

Posted on 2009-02-15
Last Modified: 2013-11-19
I am trying to upload an image with php.

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

move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\php5A3.tmp'

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 />";





      "logos/" . $_FILES["file"]["name"]);

      echo "Stored in: " . "logos/" . $_FILES["file"]["name"];





  echo "Invalid file";



Open in new window

Question by:phpretard
    1 Comment
    LVL 9

    Accepted Solution

    You need to have the write permission in the folder you are trying to upload.
    Check if you have the write permission enabled in that folder.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Building “do-it-yourself” web sites has become an epidemic. There are so many blogs, web sites and even books that "teach" you how to build your web site in a few extremely simple and easy steps. Building a web site has become easier than boiling an…
    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now