The FTP object is available as a scriptable object. This object is useful when the FTP Client Connector does not provide the required functionality. See the full documentation in the Javadocs for com.ibm.di.protocols.FTPBean.
var ftp = system.getFTP();
if ( ! ftp.connect ("ftpserver", "username",
"password") )
{
task.logmsg ("Connect failed: " +
ftp.getLastError());
}
ftp.cd ("/home/user1");
var list = ftp.dir();
while ( list.next() )
{
if (list.getType() == 1)
task.logmsg ("Directory: " +
list.getName());
else
task.logmsg ("File: " + list.getName());
}
ftp.setBinary();
ftp.get ("remotefile", "c:\\localfile");
ftp.put ("c:\\localfile", "remotefile");