Location: Seattle, WA
Posted: 2015-02-26 22:27
I have a block of code that uploads a txt file to remote SFTP.
However, I am getting the below error.
WinSCP.SessionRemoteException: Cannot initialize external console. at WinSCP.SessionLogReader.Read(LogReadFlags flags) at WinSCP.ElementLogReader.Read(LogReadFlags flags) at WinSCP.SessionElementLogReader.Read(LogReadFlags flags) at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags) at WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader() at WinSCP.Session.Open(SessionOptions sessionOptions) at XMLPostoverFTP.Class1.getFTP()
This is the block of code-
SessionOptions sessionOptions = new SessionOptions
Protocol = Protocol.Sftp,
HostName = "sftpimfs.ironmountain.com",
UserName = "Zuza",
Password = "frYG2CY9",
PortNumber = 22,
SshHostKeyFingerprint = "ssh-rsa 2048 a8:4c:12:ef:2f:29:c0:62:b7:37:5c:d4:73:0a:55:7b"
using (Session session = new Session())
session.ExecutablePath = null;
session.SessionLogPath = null;
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;
transferOptions.FilePermissions = null; //Permissions applied to remote files;
transferOptions.PreserveTimestamp = false; //Set last write time of
//destination file to that of source file - basically change the timestamp
//to match destination and source files.
transferOptions.ResumeSupport.State = TransferResumeSupportState.Off;
transferResult = session.PutFiles("/ZUZAUpload.txt", "/Outbox/", false, transferOptions);
Would be great to get some help, on where am I going wrong.
Location: Prague, Czechia
Please attach a full debug log file showing the problem (using the latest version of WinSCP).
To generate log file, set
Can you elaborate on an environment you are getting the error with?
You can post new topics in this forum
And it's free!