I've had several unseccesful attempts at copying an uploaded file (located at "C:\Documents and Settings\Daniel J Lawhead\My Documents\WWW\new grounds\admin\includes" to a directory named "images" (located at "C:\Documents and Settings\Daniel J Lawhead\My Documents\WWW\new grounds\images"). I've tried to use relavent paths ("../../images"), but with no success whatsoever. Then I tried to use abolute paths ("C:\Documents and Settings\Daniel J Lawhead\My Documents\WWW\new grounds\images"), also without success. The folder DOES exist, and it IS spelled correctly.
I have no idea what could be wrong, here's my script.
<?php
if(!is_dir("../../images/")) {
echo "Directory does not exist, creating...<br>\n";
@mkdir("../../images") or die("Error creating directory");
}
if (copy($_FILES['image']['tmp_name'], "../../images")) {
rename($_FILES['image']['tmp_name'], $_FILES['image']['name']);
echo "<img src=\"../../images/".$_FILES['image']['name']."\">Image</img>";
}
echo is_dir("../../images");
$filename = $_FILES['image']['name'];
$filepath = $_FILES['image']['dir'];
?>
I really need some help. The problem is probably quite obvious, but I'm overlooking it...