title: WinSCP: How to make sure SFTP upload gets renamed from .zip.filepart to .zip?
body: <p>Using the .NET assembly of WinSCP to upload a file.  <code>OperationResultBase.Check()</code> is throwing the following error:</p>
  
  <blockquote>
    <p>WinSCP.SessionRemoteException: Transfer was successfully finished, but temporary transfer file 'testfile.zip.filepart' could not be renamed to target file name 'testfile.zip'.  If the problem persists, you may want to turn off transfer resume support.</p>
  </blockquote>
  
  <p>It seems that this happens with any zip file that I try to send.  If it makes a difference, these are zip files that were created using the DotNetZip library.</p>
  
  <p>Code that I'm using, taken pretty much directly from the example in the WinSCP documentation:</p>
  
  <pre><code>public void uploadFile(string filePath, string remotePath)
  {
      TransferOptions transferOptions = new TransferOptions();
      transferOptions.TransferMode = TransferMode.Binary;
      TransferOperationResult transferResult;
      transferResult = currentSession.PutFiles(filePath, remotePath, false, transferOptions);
      transferResult.Check();
      foreach (TransferEventArgs transfer in transferResult.Transfers)
      {
          Console.WriteLine("Upload of {0} succeeded", transfer.FileName);
      }
  }
  </code></pre>
  
  <p><a href="http://winscp.net/forum/viewtopic.php?t=11139" rel="nofollow">Discussion over at the WinSCP forum</a> indicates that the assembly doesn't yet allow programmatic control of transfer resume support.  Is there a workaround for this?</p>