使用php上传文件时出现未定义的索引错误

时间:2015-04-11 13:43:40

标签: php undefined-index

  

警告:move_uploaded_file(../ uploads / IMG_23052014_111633.png):无法打开流:第8行的C:\ wamp \ www \ test.co \ getfile.php中没有此类文件或目录
  警告:move_uploaded_file():无法移动' C:\ wamp \ tmp \ php9EF8.tmp'到' ../ uploads / IMG_23052014_111633.png'在第8行的C:\ wamp \ www \ test.co \ getfile.php中

如何摆脱它?
HTML代码:

<form action="getfile.php" method="post" enctype="multipart/form-data" ><br>
Type (or select) Filename: <input type="file" name="uploadFile">
<input type="submit" value="Upload File">
</form>


PHP代码:

<html>
<head>
<title>Process Uploaded File</title>
</head>
<body>
<?php
move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], 
"../uploads/{$_FILES['uploadFile'] ['name']}")
?>
</body>
</html>

0 个答案:

没有答案