![如何為我的 apache 伺服器啟用上傳表單和 php 檔案?](https://rvso.com/image/1586925/%E5%A6%82%E4%BD%95%E7%82%BA%E6%88%91%E7%9A%84%20apache%20%E4%BC%BA%E6%9C%8D%E5%99%A8%E5%95%9F%E7%94%A8%E4%B8%8A%E5%82%B3%E8%A1%A8%E5%96%AE%E5%92%8C%20php%20%E6%AA%94%E6%A1%88%EF%BC%9F.png)
我正在嘗試使用curl 透過http 將檔案上傳到我的apache 伺服器。
我的伺服器根目錄中有一個簡單的 upload.php 文件,伺服器上還有一個「提交」頁面,這只是一個簡單的上傳表單。
如何將兩者連結起來一起工作,以便我可以將文件上傳到我的伺服器上?或者 .php 檔案是否足以將我的檔案上傳到伺服器?
當我使用 -v 執行curl 命令時,我得到以下輸出:
root@glennvds-VirtualBox:/home/glennvds# curl -F
‘data=@~/home/glennvds/Desktop/link.txt’ http://xx.xx.xx.xx/upload.php -v
Warning: setting file ~/home/glennvds/Desktop/link.txt’ failed!
* Trying xx.xx.xx.xx...
* TCP_NODELAY set
* Connected to xx.xx.xx.xx (xx.xx.xx.xx) port 80 (#0)
POST /upload.php HTTP/1.1
Host: xx.xx.xx.xx
User-Agent: curl/7.58.0
Accept: /
Transfer-Encoding: chunked
Content-Type: multipart/form-data; boundary=------------------------
f226a51eab6734da
Expect: 100-continue
< HTTP/1.1 100 Continue
* read function returned funny value
* stopped the pause stream!
* Closing connection 0
curl: (26) read function returned funny value