Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
in Java FTP by (210 points)
We are using com.enterprisedt.net.ftp.ssh.SSHFTPClient to transfer the file to sftp server location. We have used  com.enterprisedt.net.ftp.ssh.SSHFTPClient.setType(FTPTransferType.ASCII) to transfer the file in ASCII mode, but file is transferred as Binary file. File is simple text file without extension. Please let us know if any thing we missed to do for ASCII transfer mode .

1 Answer

0 votes
by (159k points)
ASCII mode is a bit tricky with SFTP. SFTP itself transfers only in binary mode. What the client does is try to work out the platform the server runs on, and then write the file to the server in the ASCII format for that platform.

The only way the client can find out what platform it is on is by examining the EOL sent with the welcome message. If the server doesn't adhere to convention (like yours, it seems), the client can't tell, and so it can't write the file in ASCII.