I am getting an error while uploading images to my website host. But I don't experience any problems on my WAMP server. This is the error I am getting.
[20-Aug-2013 00:58:27 America/Denver] PHP Warning: copy(/photos/Light-And-Snow.jpg) [<a href='function.copy'>function.copy</a>]: failed to open stream: No such file or directory in /home/rajeev/public_html/upload.php on line 86
The code on line 86 is
mysql_query(
"INSERT INTO
gallery_photos (
`photo_filename`,
`photo_caption`,
`photo_description`,
`photo_keywords`,
`category_name`
) VALUES(
'".addslashes($photos_uploaded['name'][$counter])."',
'".addslashes($photo_caption[$counter])."',
'".addslashes($photo_description[$counter])."',
'".addslashes($photo_keyword[$counter])."',
'".addslashes($_POST['category'])."')"
) or die(mysql_error() . 'Photo not uploaded');
$filetype = $photos_uploaded['type'][$counter];
$extention = $known_photo_types[$filetype];
// Store the orignal file
copy($photos_uploaded['tmp_name'][$counter], $images_dir."/".$photos_uploaded['name'][$counter]);
What am I doing wrong? Thanks for any directions...