?
Solved

Why do I get this pernissions error?

Posted on 2009-02-15
1
Medium Priority
?
185 Views
Last Modified: 2013-11-19
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

0
Comment
Question by:phpretard
1 Comment
 
LVL 9

Accepted Solution

by:
AsishRaj earned 2000 total points
ID: 23646582
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.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
The viewer will learn how to dynamically set the form action using jQuery.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month5 days, 3 hours left to enroll

601 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