PHP Upload File problem?

Everything seems fine and working okay when I click the “Upload” button. It shows where the photo should be stored and all the correct info like it should. The only problem is: when I go to where the photo should be located - it is not there. It is not anywhere. Please help me find the problem. Thanks for anyone who might be able to help. :slight_smile:

The Form:

[code]
Filename:

[/code]

Upload.php

[code]<?php
include ‘…/header.inc.php’; //includes database
echo “$openHTML”;

if ($_FILES[“file”][“error”] > 0)
{
echo "Error: " . $_FILES[“file”][“error”] . “
”;
}
else
{
echo "Upload: " . $_FILES[“file”][“name”] . “
”;
echo "Type: " . $_FILES[“file”][“type”] . “
”;
echo “Size: " . ($_FILES[“file”][“size”] / 1024) . " Kb
”;
echo "Stored in: " . $_FILES[“file”][“tmp_name”] . “
”;
}

 if (file_exists("graphics/images/" . $_FILES["file"]["name"]))
  {
  echo $_FILES["file"]["name"] . " already exists. ";
  }
else
  {
  move_uploaded_file($_FILES["file"]["tmp_name"],
  "graphics/images/" . $_FILES["file"]["name"]);
  echo "Stored in: " . "graphics/images/" . $_FILES["file"]["name"];
  }

echo “$closeHTML”;
?>[/code]

Check the permissions on the folder that stores your images (it should be writeable).

@jSherz Thanks! It is now working. :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service