title: Error : An exception occured during a webclient request(FTP) - Powershell 2.0
body: <p>I tried using this sample i got from a post here like :
  I'm using powershell 2.0</p>
  
  <pre><code>$File = "D:\28.csv"
  $ftp = "ftp://username:Pwd@IPAddress/in/28.csv"
  
  "ftp url: $ftp"
  
  $webclient = New-Object System.Net.WebClient
  $uri = New-Object System.Uri($ftp)
  
  "Uploading $File..."
  
  $webclient.UploadFile($uri,$File)
  </code></pre>
  
  <p>I'm trying to upload a file to an FTP server
  But i keep getting the error:</p>
  
  <pre><code>Exception calling "UploadFile" with "2" argument(s): "An exception occurred during a WebClient request."
  At D:\Scripts\test.ps1:14 char:22
  + $webclient.UploadFile &lt;&lt;&lt;&lt; ($uri,$File)
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : DotNetMethodException
  </code></pre>