I can send an HTTP POST text file to my server using the following cURL command:
curl -i -F file=@file.txt http://www.website.com/put_file
The server is expecting a file from $ _FILES ['file'].
I have the following, but it does not work:
$url = http:
$file = "c:\file.txt"
$wc = new-object System.Net.WebClient
$wc.UploadFile($url, $file.FullName)
it returns 0 and it does not load to the server
How can I send a file as $ _FILES ['file']? Also, how can I see the response from the server?
source
share