This project is read-only.

Illegal characters in SFTP File upload

Jan 23, 2015 at 1:56 PM
Edited Jan 23, 2015 at 1:59 PM
Im reading a text file from Windows into a file stream, then uploading it to openVMS.

The file uploads but when I look at it in openVMS each line has some sort of linebreak on the end that looks like a []

Is there a way I can stop these getting input?

Here is my code:
            PasswordAuthenticationMethod authMethod = new PasswordAuthenticationMethod("Buck", "Rogers");
            ConnectionInfo connectionInfo = new ConnectionInfo("space", "Buck", authMethod);

            SftpClient client = new SftpClient(connectionInfo);

           var fs = File.OpenRead(@"C:\temp\thistest.txt");

            client.UploadFile(fs, "thistest.COM");

Jan 23, 2015 at 4:49 PM
Windows and Unix-Like OS have different definitions of a newline:

If you transfer a file between them, you have to handle it yourself.
For example see git:
Feb 5, 2015 at 10:08 AM
I see so I think ill need to change the code in UploadFile to remove these breaks?