Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.1k views
in Java FTP by (340 points)
Hello,

We have the following problem when using SSHFTPClient.get in BINARY MODE.
The source file is transferred from unix box which has CL carriage return, when the file is transferred to a windows machine, all carriage returns are changed to windows CRLF.
This will cause the transferred file size to increase.

sshFtp.setType(FTPTransferType.BINARY);

Thanks,

8 Answers

0 votes
by (162k points)
In binary mode, the file is transferred byte for byte, so it should be identical.
0 votes
by (340 points)
Thanks for the reply...
We are using BINARY mode. is there anything else we can check in the code?
0 votes
by (162k points)
For starters please post the code you are using (and the version).
0 votes
by (340 points)
We have Version: 4.5.0
---------------------------
SSHFTPClient sshFtp = new SSHFTPClient();
sshFtp.getValidator().setHostValidationEnabled(false);
sshFtp.setRemoteHost(serverAddress);
sshFtp.setAuthentication(userName, password);
sshFtp.setType(FTPTransferType.BINARY);
sshFtp.connect();
sshFtp.chdir(remotePath);
sshFtp.setType(FTPTransferType.BINARY);
File localfile = new File(localPath, fileName);

System.out.println(sshFtp.getType()); //--> This line prints BINARY

sshFtp.get(localPath, fileName);
0 votes
by (162k points)
Looks ok. Enable logging at DEBUG level and send us the zipped log file (support at enterprisedt dot com)
0 votes
by (340 points)
log file is sent
0 votes
by (340 points)
Worked after setting sshFtp.setDetectTransferMode(false);
0 votes
by (162k points)
Well spotted - yes this feature can occasionally trip people up.

Categories

...