Using the .NET WinSCP assembly to download a file. OperationResultBase.Check()
throws the following error:
WinSCP.SessionRemoteException: the transfer was completed successfully, but the temporary transfer file "testfile.zip.filepart" could not be renamed to the name of the target file "testfile.zip". If the problem persists, you can disable support for resuming transfers.
This seems to be happening with any zip file I'm trying to send. If that matters, these are zip files that were created using the DotNetZip library.
The code I use is pretty much taken directly from the example in the WinSCP documentation:
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); } }
A discussion on the WinSCP forum indicates that the assembly does not yet allow programmatic control of resumption of transmission support. Is there a workaround for this?
sigil source share