Text mode upload
I need to do a text mode upload - one record and a time with the server providing proper carriage control for the platform.
UploadFile does a binary upload. I need to do a text mode transfer. Do you have an example?
@imapangolin I'm in a similar position, I want to download a file with proper carriage control (from OS/400 using EBCDIC). Did you ever figure out how to get SFTPClient or ConnectionInfo to use "text/ASCII mode" transfer?
got textmode instead of using DownloadFile or UploadFile methods with SFTP in SSH you need to use the Text methods in the session object. It is the same behaviour with other SSH SFTP libraries
PS C:\Users\admin\Documents\Posh-SSH> $sftp.Session | gm -Name *text*
TypeName: Renci.SshNet.SftpClient
Name MemberType Definition
---- ---------- ----------
AppendAllText Method void AppendAllText(string path, string contents), void AppendAllText(string path, string co...
AppendText Method System.IO.StreamWriter AppendText(string path), System.IO.StreamWriter AppendText(string pa...
CreateText Method System.IO.StreamWriter CreateText(string path), System.IO.StreamWriter CreateText(string pa...
OpenText Method System.IO.StreamReader OpenText(string path)
ReadAllText Method string ReadAllText(string path), string ReadAllText(string path, System.Text.Encoding encod...
WriteAllText Method void WriteAllText(string path, string contents), void WriteAllText(string path, string cont...
here is an example with chilkat where they also address this the same way https://cknotes.com/binary-vs-text-transfers-sftp-ftp/
@darkoperator Perfect, thanks for the quick response! I was not at all aware what those methods were for, makes a lot of sense now
@darkoperator thanks for the help!