Using FTPClient to Integrate Backend Systems

Salesforce B2C Commerce implements an FTP client in the B2C Commerce Script API to enable developers to access remote locations via the FTP protocol. The FTPClient class can be used to pull or push files that don't have to be transmitted securely. Because it isn't a secure transfer protocol, we recommend that you use the FTPClient only for sandboxes.

The FTPClient class supports the FTP commands CD, GET, PUT, DEL, MKDIR, RENAME, and LIST. Because the RMD command isn't supported, it isn't possible to delete directories using the B2C Commerce FTP client.

The FTP connection is established using passive transfer mode (PASV). The transfer of files can be text or binary.
Note: The FTPClient.setTimeout method sets the socket, data channel, and script timeouts for the FTP call. Each timeout is set to this value, so the total timeout can be longer than the value set.
Example:
var ftp : FTPClient = new dw.net.FTPClient();
ftp.connect("http://www.myinstance.com", "username", "password");
var data : String = ftp.get("simple.txt");
If you want to use the FTPClient class, you must contact Salesforce Support to have a firewall rule installed. Include the following information in your support case:
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.