Duplicate Carriage Returns (Character 13) Being Removed on SFTP Download.

0 votes
asked Mar 25, 2011 by Andrew 1 (120 points)
edited Mar 28, 2011

I'm replacing earlier ftp software with Rebex. One of the jobs I'm replacing uses SFTP to move files. For an uknown reason the files records end with two carriage returns (i.e. ascii 13's). It appears that the system that these files are sent to require these duplicate carriage returns. Although the previous ftp software left the file with the two carriage returns, Rebex appears to remove one of them so that you end up with the file just containing one carriage return after each line. I've tried moving the file in ascii and binary but both methods remove the extra carriage return. Has anyone got any ideas please?

Applies to: Rebex SFTP

1 Answer

0 votes
answered Mar 28, 2011 by Lukas Pokorny (123,810 points)
edited Mar 28, 2011

Does this happen when uploading a file or downloading the file? Are you using Rebex FTP/SSL (Rebex.Net.Ftp.dll's Ftp object) or Rebex SFTP (Rebex.Net.Sftp.dll's Sftp object)?

In binary mode, Rebex SFTP and Rebex FTP/SSL doesn't remove or add any characters at all. This makes it appear that the removal is caused by something else. Have you considered the possibility that it was the previous SFTP software that actually caused the two CR characters to appear?

If you are using Rebex SFTP, try transfering the file using PuTTY's "psftp" command line utility. This is a very simple SFTP client which only supports binary mode and doesn't have any advanced features. Does it behave just like Rebex SFTP in binary mode or not?

commented Mar 28, 2011 by Andrew 1 (120 points)
Thanks for the reply. It appears that our previous sftp software was adding on CR's when downloading. The application that receives the file was designed around this so, when we introduced Rebex, which doesn't change the file, the application had problems.
...