我有一個簡單的HTML文件,帶有一個表單上傳文件和PHP代碼來處理上傳的文件。我試過了一堆input
類型,除input type="file"
之外它們都工作。沒有顯示。該代碼已附加。用於文件上傳的HTML表單不會返回文件名
<!DOCTYPE html>
<html>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data"> Select image to upload:
<input type="file" name="test.f" id="test.f">
<input type="submit" value="Upload Image" name="submit">
</form>
</body>
</html>
處理PHP代碼爲:
<?php
echo "Hello world";
echo $_FILES["test.f"];
?>
'test.f更改文件名'不是定義這些的好方法。 –
閱讀手冊http://php.net/manual/en/function.move-uploaded-file.php --- http://php.net/manual/en/features.file-upload.php而你'關於PHP.net => http://php.net/manual/en/function.error-reporting.php,看看會發生什麼。 –