Winscp uploading failed using C# code
Hi All,
Am using Winscp for file moving one machine to another.
its less than 100kb file moving correctly without error.
But more than 100kb file not moving.
Showing Following log
2017-03-22 16:32:05.962 Binary transfer mode selected.
. 2017-03-22 16:32:05.962 Checking existence of file.
> 2017-03-22 16:32:05.962 Type: SSH_FXP_LSTAT, Size: 46, Number: 263
< 2017-03-22 16:32:05.977 Type: SSH_FXP_STATUS, Size: 33, Number: 263
< 2017-03-22 16:32:05.977 Status code: 2
. 2017-03-22 16:32:05.977 Checking existence of partially transfered file.
> 2017-03-22 16:32:05.977 Type: SSH_FXP_LSTAT, Size: 55, Number: 519
< 2017-03-22 16:32:05.977 Type: SSH_FXP_STATUS, Size: 33, Number: 519
< 2017-03-22 16:32:05.977 Status code: 2
. 2017-03-22 16:32:05.977 Opening remote file.
> 2017-03-22 16:32:05.977 Type: SSH_FXP_OPEN, Size: 71, Number: 771
< 2017-03-22 16:32:05.993 Type: SSH_FXP_STATUS, Size: 33, Number: 771
< 2017-03-22 16:32:05.993 Status code: 2, Message: 771, Server: File not found, Language: en
> 2017-03-22 16:32:05.993 Type: SSH_FXP_LSTAT, Size: 55, Number: 1031
< 2017-03-22 16:32:05.993 Type: SSH_FXP_STATUS, Size: 33, Number: 1031
< 2017-03-22 16:32:05.993 Status code: 2, Message: 1031, Server: File not found, Language: en
* 2017-03-22 16:32:05.993 (ETerminal) No such file or directory.
* 2017-03-22 16:32:05.993 Error code: 2
* 2017-03-22 16:32:05.993 Error message from server (en): File not found
. 2017-03-22 16:32:05.993 Asking user:
. 2017-03-22 16:32:05.993 Cannot create remote file '/input/TEST.zip.pgp.filepart'. ("No such file or directory.
. 2017-03-22 16:32:05.993 Error code: 2
. 2017-03-22 16:32:05.993 Error message from server (en): File not found")
< 2017-03-22 16:32:05.993 Script: Cannot create remote file '/input/TEST.zip.pgp.filepart'.
< 2017-03-22 16:32:05.993 Script: No such file or directory.
< 2017-03-22 16:32:05.993 Error code: 2
< 2017-03-22 16:32:05.993 Error message from server (en): File not found
* 2017-03-22 16:32:05.993 (EScpSkipFile) Cannot create remote file '/input/TEST.zip.pgp.filepart'.
* 2017-03-22 16:32:05.993 No such file or directory.
* 2017-03-22 16:32:05.993 Error code: 2
* 2017-03-22 16:32:05.993 Error message from server (en): File not found
Am using Winscp for file moving one machine to another.
its less than 100kb file moving correctly without error.
But more than 100kb file not moving.
/ Setup session options SessionOptions sessionOptions = new SessionOptions { Protocol = ftpMode.ToUpper().ToString() == "SFTP" ? Protocol.Sftp : Protocol.Scp, HostName = hostname, UserName = username, Password = password, PortNumber = port, GiveUpSecurityAndAcceptAnySshHostKey = true, SshPrivateKeyPath = sshprivetekeypath }; using (Session session = new Session()) { // Connect session.Open(sessionOptions); // Upload files TransferOptions transferOptions = new TransferOptions(); transferOptions.FileMask = filemask; transferOptions.TransferMode = TransferMode.Binary; TransferOperationResult transferResult; //transferResult = session.GetFiles("/home/user/*", "d:\\download\\", false, transferOptions); transferResult = session.GetFiles(sourcepath, destinationpath, false, transferOptions); // Throw on any error transferResult.Check(); }
Showing Following log
2017-03-22 16:32:05.962 Binary transfer mode selected.
. 2017-03-22 16:32:05.962 Checking existence of file.
> 2017-03-22 16:32:05.962 Type: SSH_FXP_LSTAT, Size: 46, Number: 263
< 2017-03-22 16:32:05.977 Type: SSH_FXP_STATUS, Size: 33, Number: 263
< 2017-03-22 16:32:05.977 Status code: 2
. 2017-03-22 16:32:05.977 Checking existence of partially transfered file.
> 2017-03-22 16:32:05.977 Type: SSH_FXP_LSTAT, Size: 55, Number: 519
< 2017-03-22 16:32:05.977 Type: SSH_FXP_STATUS, Size: 33, Number: 519
< 2017-03-22 16:32:05.977 Status code: 2
. 2017-03-22 16:32:05.977 Opening remote file.
> 2017-03-22 16:32:05.977 Type: SSH_FXP_OPEN, Size: 71, Number: 771
< 2017-03-22 16:32:05.993 Type: SSH_FXP_STATUS, Size: 33, Number: 771
< 2017-03-22 16:32:05.993 Status code: 2, Message: 771, Server: File not found, Language: en
> 2017-03-22 16:32:05.993 Type: SSH_FXP_LSTAT, Size: 55, Number: 1031
< 2017-03-22 16:32:05.993 Type: SSH_FXP_STATUS, Size: 33, Number: 1031
< 2017-03-22 16:32:05.993 Status code: 2, Message: 1031, Server: File not found, Language: en
* 2017-03-22 16:32:05.993 (ETerminal) No such file or directory.
* 2017-03-22 16:32:05.993 Error code: 2
* 2017-03-22 16:32:05.993 Error message from server (en): File not found
. 2017-03-22 16:32:05.993 Asking user:
. 2017-03-22 16:32:05.993 Cannot create remote file '/input/TEST.zip.pgp.filepart'. ("No such file or directory.
. 2017-03-22 16:32:05.993 Error code: 2
. 2017-03-22 16:32:05.993 Error message from server (en): File not found")
< 2017-03-22 16:32:05.993 Script: Cannot create remote file '/input/TEST.zip.pgp.filepart'.
< 2017-03-22 16:32:05.993 Script: No such file or directory.
< 2017-03-22 16:32:05.993 Error code: 2
< 2017-03-22 16:32:05.993 Error message from server (en): File not found
* 2017-03-22 16:32:05.993 (EScpSkipFile) Cannot create remote file '/input/TEST.zip.pgp.filepart'.
* 2017-03-22 16:32:05.993 No such file or directory.
* 2017-03-22 16:32:05.993 Error code: 2
* 2017-03-22 16:32:05.993 Error message from server (en): File not found