無法在我的 apache 伺服器上傳簡單的 .txt 文件

無法在我的 apache 伺服器上傳簡單的 .txt 文件

我建立了一個 HTML 表單來在我自己的 apache 伺服器上上傳檔案:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <title>upload</title>
</head>
<body>
  <form action="http://localhost:8000" method="post" enctype="multipart/form-data">

  <p><input type="file" name="file1">

  <p><button type="submit">Submit</button>
</form>
</body>
</html>

我更改了 Apache 配置中偵聽的端口,重新啟動了 Apache 服務,然後打開表單並單擊按鈕上傳 .txt 檔案。

結果:出現了 Apache 的預設頁面,但是當我檢查中的檔案時

/var/www/html

沒有文件。

我不明白為什麼上傳失敗。任何想法 ?

相關內容