title: Unable to download file into directory using WinSCP .NET assembly
body: <p>I'm implementing the WinSCP .NET Assembly for SFTP functionality. I am able to establish a session, list directories and download files to <code>\bin\x86\Debug</code>, but for some reason I am unable to download files into directory <code>bin\x86\Debug\edi</code> on my local drive.</p>
  
  <p>Download code:</p>
  
  <pre><code>public static List&lt;string&gt; GetSFTP(string host, string user, string password, int port, string source, string dest, string remoteDest)
  {
      List&lt;string&gt; filenames = new List&lt;string&gt;();
      System.IO.Directory.CreateDirectory(dest);
  
      SessionOptions winSCPSessionOptions = new SessionOptions();
      winSCPSessionOptions.HostName = host;
      winSCPSessionOptions.Password = password;
      winSCPSessionOptions.PortNumber = port;
      winSCPSessionOptions.UserName = user;
      winSCPSessionOptions.Protocol = WinSCP.Protocol.Sftp;
  
      // This is a kind of dangerous setting, but as we do not have the host
      // key fingerprints this allows us to connect without complaint.
      winSCPSessionOptions.GiveUpSecurityAndAcceptAnySshHostKey = true;
  
      Session session = new Session();
      session.Open(winSCPSessionOptions);
      RemoteDirectoryInfo remoteDirInfo = session.ListDirectory(remoteDest);
      foreach (RemoteFileInfo fileInfo in remoteDirInfo.Files)
      {
          if (fileInfo.Name.Equals(".") || fileInfo.Name.Equals("..")) { continue; }
          Console.WriteLine("{0}", remoteDest + fileInfo.Name);
          try
          {
              TransferOperationResult result = session.GetFiles(remoteDest + fileInfo.Name, dest+fileInfo.Name);
              if (!result.IsSuccess)
              {
                  Console.WriteLine("Failed to download!");
                  foreach (SessionException ex in result.Failures)
                  {
                      Console.WriteLine(ex.ToString());
                  }
              }
              else
              {
                  Console.WriteLine("Successfully downloaded file!");
              }
          }
          catch (Exception e)
          {
              Console.WriteLine(e.ToString());
          }
  
          filenames.Add(fileInfo.Name);
      }
  
      return filenames;
  }
  </code></pre>
  
  <p>Called via:</p>
  
  <pre><code>GetSFTP("sftp.server.com", "user", "password", 22, "/ProcessedFiles/", "edi/", "/ProcessedFiles/Processed/");
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>GetSFTP("sftp.server.com", "user", "password", 22, "/ProcessedFiles/", "/edi/", "/ProcessedFiles/Processed/");
  GetSFTP("sftp.server.com", "user", "password", 22, "/ProcessedFiles/", "\\edi\\", "/ProcessedFiles/Processed/");
  GetSFTP("sftp.server.com", "user", "password", 22, "/ProcessedFiles/", "edi\\", "/ProcessedFiles/Processed/");
  </code></pre>
  
  <p>In all cases I get a varient of: <code>%2Fedi%2Ffilename.txt</code> downloaded to my working directory, not the specified path.</p>