Wazzup everybody...
I wrote a script that uses a form to saelect a file and upload it, and the code I'm, using to copy it to a different part of the directory. The code I'm using is shown below. It says it's going to a tmp directory, but I can't specify any pther place for it to go - when I try, it won't werk.
ERROR:
You submitted this file:
Name: /tmp/phpd6I3HZ
Origional Name: Lazzerous.JPG
Size: 39953
Type: image/pjpeg
File successfully copied!
Warning: Unlink failed (No such file or directory) in /usr/httpd/virtual/www.firestonesports.com/html/test/lazz/uploadtest2.php on line 23
Even though it says the file was successfully copied, it doesn't show...
here's the code:
<code>
<head>
<title>Upload Test 2</title>
<body bgcolor="white" text="black" link="blue" vlink="navy">
<?php
if ($submit) {
echo "You submitted this file:<br>\n";
echo "Name: $image<br>\n";
echo "Origional Name: $image_name<br>\n";
echo "Size: $image_size<br>\n";
echo "Type: $image_type<br><br><br>\n";
if (copy($image, "/$image")) {
echo "File successfully copied!<br>\n";
}
else {
echo "ERROR: Failed to copy file<br>\n";
}
unlink($fyle);
}
else {
echo "<form method=\"post\" action=\"$PHP_SELF\" enctype=\"multipart/form-data\">\n";
echo "Submit this image: <input type=\"file\" name=\"image\"><br>\n";
echo "<input type=\"submit\" name=\"submit\" value=\"Upload!\">\n";
echo "</form>\n";
}
?>
</body>
</code>
Any help woul;d be greatly appreciated.
Thanks,
Lazz