Location: Bangalore, India
Posted: 2013-10-14 19:40
We use WinSCP tools (WinSCP.exe, WinSCP.dll) for our C# Project for SecureFTP. Attaching the WinSCP DLL & INI files as a Zip file to know about their versions.
We connect to WinSCP for Secure FTP of different files to different FTP Servers simultaneously.
Getting the error "The remote server returned an error: (500) Syntax error, command unrecognized." most of the times.
Getting "Network error: Connection timed out." also at some times.
These errors are not occurring for the same file/server each time.
So, not able to find out the pattern when the error occurs.
These errors are not related to : Size of the file or connecting to same server simultaneously using Threads.
Please go through the code part given below and let me know what could be reason for errors.
This is the code part related to WinSCP which will be called every time a File has to be FTP-ed :
Session Options setting :
SessionOptions sessionOptions = new SessionOptions
FtpMode = FtpMode.Passive,
Protocol = Protocol.Sftp,
HostName = ftpServerIP,
UserName = ftpUserID,
Password = ftpPassword,
GiveUpSecurityAndAcceptAnySshHostKey = true
using (Session session = new Session())
session.ExecutablePath = CurrentPath + "WinSCP_EXE\\WinSCP.exe";
session.IniFilePath = CurrentPath + "WinSCP_EXE\\WinSCP.ini";
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Automatic;
transferResult = session.PutFiles(sourcePath, remotePath, false, transferOptions);
foreach (TransferEventArgs transfer in transferResult.Transfers)
// Display transfer.FileName
//Contents of Exception Handling
Please let me know what could be reason of the error and why it fails at different place and different times. Thanks in advance, for the help.
Description: Attaching the Zip containing the DLL & INI File for identifying the Versions.
Location: Prague, Czechia
Please attach a full session log file showing the problem (using the latest version of WinSCP).
To generate log file, set
You can post new topics in this forum
And it's free!