我想在服务器上的数据库中上传视频和图片。我使用了以下代码,但是当我在localhost
中使用此代码时,它可以正常工作,但是当我通过服务器上传时,它会显示错误。
这是我的代码:
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ".basename( $_FILES['uploaded']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
以下是错误消息:
警告:move_uploaded_file(upload / logo.JPG)[function.move-uploaded-file]:失败 打开流:C:\ Inetpub \ vhosts \ hiznherzbridalshow.com \ httpdocs中的权限被拒绝 第31行\ hiznherz_new \ test2.php
警告:move_uploaded_file()[function.move-uploaded-file]:无法移动
C:\ Inetpub \ vhosts中的'C:\ Windows \ Temp \ php7648.tmp'到'upload / logo.JPG' 第31行\ hiznherzbridalshow.com \ httpdocs \ hiznherz_new \ test2.php
答案 0 :(得分:2)