I'm backing up my hard drive on the cloud with a filehost. This filehost provides an API to do it but i just can't get it works on powershell.
On their API website (http://code.google.com/p/filecloud/wiki/Uploading) they claim that "We upload the file via HTTP POST request" so I use my trusty POST_Request function:
function POST_Request ($url,$parameters) {
$client = New-Object System.Net.WebClient
$contents = [Text.Encoding]::UTF8.GetString(($client.UploadValues($url,$parameters) ))
return $contents
}
Since they website claim that they need 2 parameters to be sent in order to upload (a kind of id of my account and the file) i cannot use UploadFile in a System.Net.WebClient object.
In summary, my question is: How can I pass a parameter (the id) AND the file to be uploaded via POST? (maybe a trick with UploadFile will do it)
Many thanks in advance!