我有一个 php 页面,应该将上传的图像存储到我的服务器。当我运行它时,我收到“上传成功”消息,但图片尚未上传。会是什么呢?
更新:人们可以就他们为什么对我的问题投反对票发表评论。我是新来的,我不知道为什么这个问题被否决了。谢谢
<?
if(!empty($_FILES['uploaded_file'])) {
if ($_FILES['uploaded_file']['error'] > 0 )
echo "Error: " . $_FILES['uploaded_file']['error'] . "<br />";
else{
// Add the original filename to target path.
$target_path = 'MemberPics\\user'.$userid.'.jpg' ;
$success = move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $target_path);
if(!$success) {
echo "There was an error uploading the file, please try again!";
}else {
echo "Upload successful, please go back to your home page";
}
}
}
?>