我已经编写了这个用于将图像从任何远程计算机上传到服务器上传目录的PHP代码
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/jpg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 1000000))
{
$filename=$_FILES["file"]["name"];
move_uploaded_file($_FILES['file']['tmp_name'],"upload/".$filename);
} else {
echo "invalid file";exit;
}
答案 0 :(得分:0)
您可以尝试将上传文件夹更改为:
move_uploaded_file($_FILES['file']['tmp_name'],"./upload/".$filename);