如何為我的 apache 伺服器啟用上傳表單和 php 檔案?

如何為我的 apache 伺服器啟用上傳表單和 php 檔案?

我正在嘗試使用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

相關內容