将图像上传到我的网站主机时出现错误。但我在 WAMP 服务器上没有遇到任何问题。这是我得到的错误。
[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
第 86 行的代码是
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]);
我究竟做错了什么?感谢您的任何指示...