我可以使用以下cURL命令發送HTTP POST一個文本文件到我的服務器:PowerShell的等效cURL命令上傳文件
curl -i -F [email protected] http://www.website.com/put_file
服務器預計從$ _FILES [「文件」]文件。
我見到目前爲止以下,但它不工作:
$url = http://www.website.com/put_file
$file = "c:\file.txt"
$wc = new-object System.Net.WebClient
$wc.UploadFile($url, $file.FullName)
返回0,並沒有上傳到服務器
我如何發送文件作爲$ _FILES [」文件']?另外,我怎樣才能看到服務器的響應?
我結束了下載curl可執行文件的窗口,它的奇蹟! – Takashi 2013-06-03 16:25:18