Hello everybody:
I'm trying to let my users upload their images on my site, but when I run my script, I get the following message:
"Warning: copy(images/1217191458.jpg) [function.copy]: failed to open stream: No such file or directory in /home/xxx/public_html/upload/upload_image.php on line xx"
This is the script (abbreviated):
<?php
$image_name=time().'.'.$extension;
$newname="images/".$image_name;
echo "NEWNAME: ".$newname."<br />";
$copied = copy($_FILES['image']['tmp_name'], $newname);
if (!$copied)
{
echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;
}}}}
?>
how does it finds the file? Thank you.
I'm trying to let my users upload their images on my site, but when I run my script, I get the following message:
"Warning: copy(images/1217191458.jpg) [function.copy]: failed to open stream: No such file or directory in /home/xxx/public_html/upload/upload_image.php on line xx"
This is the script (abbreviated):
<?php
$image_name=time().'.'.$extension;
$newname="images/".$image_name;
echo "NEWNAME: ".$newname."<br />";
$copied = copy($_FILES['image']['tmp_name'], $newname);
if (!$copied)
{
echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;
}}}}
?>
how does it finds the file? Thank you.