The files downloaded by this, are nearly the same size but differ in some lines. Every answer points to binary file type. But this won\'t help. Got anybody an idea for the p
It's clear from the files you have shared, that the transfer indeed happened in text/ascii mode.
While probably not required by FTP specification, with some FTP servers (e.g. FileZilla server), you cannot change transfer type before logging in. But servers like IIS, ProFTPD or vsftpd have no problem with that. On the other hand FileZilla server defaults to binary mode anyway (what is another violation of the specification), so you are probably using yet another one.
In any case, move the .setFileType
call after .login
. And test its return value.
And remove the .setFileTransferMode
call. It does not do any harm with most servers, as hardly any server support MODE C
, hence the call is ignored anyway. But if you encounter a server that does, it would break the transfer, as FTPClient
actually does not support it.