Hi, we are having problem transfering PGP file using edtFTPj (free). The receiver cannot decrypt the transferred pgp file. But it can decrypt if we manually ftp the same pgp file. We also tried to use FTPTransferType.BINARY, but it did not work either.
maybe we should use streaming? Please help! thank you so much!!!
here is our code:
public static void ftp(String host, String user, String password, String data, String path,
String fileName) throws Exception
{
logger.info("-->Starting to ftp " + fileName);
FTPClient ftp = new FTPClient();
ftp.setRemoteHost(host);
// ftp.setRemotePort(21);
ftp.connect();
ftp.login(user, password);
ftp.setType(FTPTransferType.ASCII);
ftp.chdir(path);
ftp.put(data.getBytes(), fileName);
ftp.setConnectMode(FTPConnectMode.PASV);
ftp.quit();
logger.info("-->Finished ftping " + fileName);
}
public static void ftpFile(String host, String user, String password, String origFileFullName, String path,
String fileName) throws Exception
{
ftp(host, user, password, readFile(origFileFullName), path, fileName);
}