I’m using Zehon SFTP client to transfer files using SFTP. My source files are ASCII files (pipe delimited text files). After the transfer is complete, at the destination, all the files have these additional characters at the beginning of the file:∩╗┐. These are not visible in windows based text editors, but they do show when I see the content of the file using the DOS ‘type’ command.
I believe this is caused because the ascii files are being transferred using binary mode. And this could easily be fixed if I set the transfer mode to ASCII. But I’m unable to find an API method to set the transfer mode in Zehon SFTP (I thought this would be a standard method in all FTP/SFTP clients). I have searched the java docs (http://www.zehon.com/javadocs/index.html) thoroughly (atleast that’s what I believe). Any help to fix/overcome this is appreciated.
Using a different client is definitely an option but that would require considerable re-work effort. So, I’m trying to find out a way to fix this using Zehon SFTP client itself.
Those characters are most likely UTF-8 indicator. They have nothing to do with binary transfer mode (which must NOT change files in any case). I think that you have these characters in the beginning of files on your local system OR they are appended by some other software.
BTW SFTP protocol is not related to FTP in any way and until version 4 SFTP didn’t have ASCII mode, so it’s no wonder that you can’t find the corresponding property.