Reputation: 1671
I have problem where I need to transfer huge files from server to client through FTP which taking lot of time. We are currently using FTPClient available in apache.commons.net library.
So question is - Does FTPClient compress file while transfer? OR Is there any way I fasten the transfer?
Any pointers or related information would be of great help!
Upvotes: 1
Views: 2121
Reputation: 314
Yes that's called Mode Z (or Compressed Transfer Mode).
FTPClient ftpClient = new FTPClient();
ftpClient.connect(server.getServer());
ftpClient.login(server.getUsername(), server.getPassword());
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
ftpClient.setFileTransferMode(FTP.COMPRESSED_TRANSFER_MODE);
You can also obviously compress the files on the server side then send them via standard FTP (it should be the same in the end).
Upvotes: 2