【发布时间】:2018-03-12 03:43:14
【问题描述】:
我正在尝试将文件上传到我的 php 服务器,然后返回文件名以显示在 html 文档中。但我得到以下
`error: Objektet wasn't found! The requested address was not found on this server. The link on the previous page appears to be incorrect or out of date Error 404
localhost
Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.8`
我的 html 文档
<html>
<body>
<form method="post" enctype="multipart/form-data" action="server.php">
<input type="file" name="fileToUpload" id="fileToUpload" size="35">
<br>
<br>
<input type="submit" value="Upload" name="submit">
</body>
</html>
我的 php 文档
<?php
header('Content-type: text/plain');
if(isset($_POST["fileToUpload"])){
$file = $_FILES["fileToUpload"];
echo("File: ".$file);
}
?>
【问题讨论】: