title: Upload file via HTTP POST in powershell
body: <p>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.</p>
  
  <p>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 <code>POST_Request</code> function:</p>
  
  <pre><code>function POST_Request ($url,$parameters) {
  $client = New-Object System.Net.WebClient 
  $contents = [Text.Encoding]::UTF8.GetString(($client.UploadValues($url,$parameters) ))
  return $contents
  }
  </code></pre>
  
  <p>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 <code>UploadFile</code> in a <code>System.Net.WebClient</code> object.</p>
  
  <p>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 <code>UploadFile</code> will do it)</p>
  
  <p>Many thanks in advance!</p>