我正在使用move_upload()
功能。我以不同的方式命名所有图像。它使用正确的名称上传到数据库,但它不会显示在图像文件夹中。
下面是我的代码,因为evrything正确上传。
echo $post_image=$_FILES['image']['name'];
echo $post_imagea=$_FILES['imagea']['name'];
echo $post_imageb=$_FILES['imageb']['name'];
echo $image_tmp=$_FILES['image']['tmp_name'];
echo $imagea_tmp=$_FILES['imagea']['tmp_name'];
echo $imageb_tmp=$_FILES['imageb']['tmp_name'];
echo $post_description=$_POST['description'];
echo $post_description=$_POST['description'];
if($post_title=='' or $post_keywords=='' or $post_description=='' or $post_price==''){
echo "<script> alert('none of the fields can be empty, try again')</script>";
} else {
move_uploaded_file($image_tmp,"../images/$post_image/");
}
答案 0 :(得分:0)
您是否在/ images / map上设置了正确的权限?
它应具有读/写/执行权限,以便将图像移动到文件夹
答案 1 :(得分:0)
替换
move_uploaded_file($image_tmp,"../images/$post_image/");
move_uploaded_file($image_tmp,"../images/".$post_image);