擋案上傳一只顯是錯誤訊息

edited 九月 2014 in PHP新手區
=================test3.php===============
<head>
<title>
</title>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<body>

<form method="post" enctype="multipart/form-date" action="test4.php" >
<p>
<input type="file" name="UpFile"><br>


<input type="submit" value="送出">
</p>
</form>
</body>
==================test4.php======================
<head>
<title>
</title>
</head>
<body>
<?php
header("content-type:text/html;charset=utf-8");
$upload_dir='./rrr/';
if($_FILES['UpFile']['error'] == UPLOAD_ERR_OK)
{
move_uploaded_file($_FILES['UpFile']['tmp_name'],$upload_dir.$_FILES['UpFile']['name']);	
 echo'上傳成功';
 echo'<br/>原始檔名:'.$_FILES['UpFile']['name'];
 echo'<br/>檔案大小:'.$_FILES['UpFile']['size'];
 echo'<br/>檔案類型:'.$_FILES['UpFile']['type'];
 echo'<br/>暫存擋名:'.$_FILES['UpFile']['temp_name'];
	
}
else
{
echo"失敗";
}
?>

</body>
=================================================
我一直修改網頁一只顯示錯誤訊息Notice: Undefined index: UpFile , 她為什麼會找不到UpFile的值. 我一只copy"UpFile"過去還是一樣的結果

評論

Sign In or Register to comment.