I'm having trouble creating a form that will upload and store images.
After uploading (submitting the form), I get this with the print_r($FILES)
function:
Array ( [Image] => Array ( [name] => 4HfoEtn.jpg [type] => image/jpeg [tmp_name] => C:\Windows\Temp\php151F.tmp [error] => 0 [size] => 70107 ) )
However, when navigating to C:\Windows\Temp\ in my file browser, the file does not exist.
Furthermore, when I run:
$tmp_image_dir = basename($_FILES['Image']['tmp_name']);
echo "<img src=\"" . $tmp_image_dir . "\">" . "<br>";
No image shows up.
Also, when I run:
$image_dir = "/images/";
$image_dir = $image_dir . basename($_FILES['Image']['name']);
if(move_uploaded_file($_FILES['Image']['tmp_name'], $image_dir)) echo "Image Uploaded Successfully" . "<br>";
I do not get a readout of "Image Uploaded Successfully"
Then, pretty obviously, when I run:
echo "<img src=\"" . $image_dir . "\">" . "<br>
I also get an image placeholder with no image.