Import To List Via FTP

Imports the CSV list data with the auto import XML file to the user’s FTP directory.


Function

  • importToListViaFTP()

Parameters

  • username: String
    • Account login name.
  • password: String
    • Account password.
  • csvFileName: String
    • filename used for import. Filename used for .xml and .go file.
  • csvFileData: byte[]
    • CSV file content data
  • xmlControlFileData: byte[]
  • fieldNames: String
    • custom field names for the list. Maximum 25 fields allowed.

Return

  • int:
    • 1: success
    • 0: failed

Exception

  • Exception

Documentation

  • Imports the CSV list data with the auto import XML file to the user’s FTP directory.
  • Ensure the account’s FTP directory has been setup.

Examples

public void importToListViaFtpSample() throws java.lang.Exception {

        String username = "XXX";
        String password = "XXX";
        String csvFileName = "theNameOfCsv.csv";

        File csvFile = new File("csvFile.csv");
        byte[] csvFileData = Files.readAllBytes(csvFile.toPath());

        File xmlControlFile = new File("xmlControlFile.xml");
        byte[] xmlControlFileData = Files.readAllBytes(xmlControlFile.toPath());

        int result = port.importToListViaFTP(username, password, csvFileName, csvFileData, xmlControlFileData);

}
<?php


?>