File Transfer (FTP/SFTP) data source

Applies to Infiniti v8.1 or later
 
 
The File Transfer (FTP/SFTP) Data Source grants designers the ability to include stored data from remote server in their generated documents via Secure File Transfer Protocol.
 
To do this:
 
1. Add the File Transfer (FTP/SFTP) Connection Settings:
 
1.1 Add the File Transfer (FTP/SFTP) Connection Settings through Connector Settings in Manage (refer to the Connector settings article).
      
Note: The Connection Settings added through Connector Settings in Manage will be the Default Connection Settings to be used for every File Transfer (FTP/SFTP) Data Source .               
 
Both  File Transfer (FTP/SFTP) Data Source and  File Transfer (FTP/SFTP) action share the same Connector Settings.
 
                                                         
        
From the above list, the following 7 attributes are mandatory and must be added to any File Transfer (FTP/SFTP) Data Source for it to function correctly.
 
  • Default Host: IP Address of the remote server you are going to get data from.
  • Default Username: Username to login to that server.
  • Default Password: Password to login to that server.
  • Default Working Directory: The particular directory in that server where the file that stores data locates(e.g. /upload). Please note that if there is no particular directory you want to upload the documents to, “/” should still be entered.
  • Default Port: Enter the port number to establish connection to the remote server (e.g. 22 for SFTP Transfer and Port 21 for FTP Transfer).
  • Default Protocol [FTP/SFTP]: Specify the protocol, either “sftp” or “ftp”.
  • Default Create Folder [True/False]: This attribute should only be changed if you would like to use the  File Transfer (FTP/SFTP) Action. Its default value will be set to False.
 
    1.2 Open the Data Source tab in Manage and click New Data Source button:
 
                                      
   
    1.3  Enter Data Source Name the select Connection Type from the drop-down list. In this case SFTPDataSource will be chosen:
 
                
 
  1.4 Enter the Connection String for the specified SFTPDataSource : 
  
       A SFTPDataSource Connection String is made up of the following parts:

csv = data-source-path; fields = field-name1, field-name2,….; hdr = header-row-number; delimiter = delimiter-character; skipheaderrows = number; skipfooterrows= number; widths = width-of-field-1, width-of-field-2,….;

 

Connection String Parameters

 Description

csv (mandatory)

Path to the text or csv file

fields (mandatory)

Names of the fields in the order they appear in the file.

Hdr

Specifies the row which is to be considered as the header to retrieve the names of each columns

widths

Sets column widths if the text file data source has a fixed width format. Use -1 for a variable width data source

delimiter

Set a custom field delimiter. When this value is not supplied the default comma delimiter will be used.

skipheaderrows

If the text file contains header rows that need to be skipped. State the number of rows to ignore from the top of the CSV file.

skipfooterrows

If the text file contains footer rows that need to be skipped.

 

The parameters csv and fields/hdr are mandatory and the remaining are optional in a SFTPDataSource connection string.

Example Connection Strings:
  • csv=book1.csv;fields=Name,CategoryId;hdr=1;delimiter=|
  • csv=book1.txt;fields=Name,CategoryId;widths=10,5
  • csv=book1.csv;fields=Name,CategoryId;skipheaderrows=2;skipfooterrows=2
 
Note: As the file is located in remote server, the full file path will not be required. Only the File name.File extension format should be entered (e.g. csv =book.csv)
   1.5 Enter the Credentials that will be used to connect to the remote server:
         
  1.6 Click the Test Connection button to check whether the connection has been established:         

          

1.7 Click Save and the SFTPDataSource will be ready for use.
 
2. You can customize your SFTPDataSource so that different Data Sources can pull data from different remote servers.
 
This can be achieved by adding File Transfer (FTP/SFTP) Connection Settings through Data Source Connection String.
 
Note: The Connection Settings entered using this method instead will override the Default Connection Settings for the particular Data Source you are working on.
 
   To do this:
           
   2.1  Enter the Connection String for the specified SFTPDataSource 
  
   A SFTPDataSource Connection String is made up of the following parts:

csv = data-source-path; fields = field-name1, field-name2,….; hdr = header-row-number; delimiter = delimiter-character; skipheaderrows = number; skipfooterrows= number; widths = width-of-field-1, width-of-field-2,host = host-ip-address, port = port-number, workingdirectory = working-directory, protocol = sending-protocol;

 

Connection String Parameters

 Description

csv (mandatory)

Path to the text or csv file

fields (mandatory)

Names of the fields in the order they appear in the file.

host (mandatory)

IP Address of the remote server you are going to get data from.

port (mandatory)

Enter the port number to establish connection to the remote server (e.g. 22 for SFTP Transfer and Port 21 for FTP Transfer).

workingdirectory (mandatory)

The particular directory in that server where the file that stores data locates(e.g. /upload). Please note that if there is no particular directory you want to upload the documents to, “/” should still be entered.

protocol (mandatory)

Specify the protocol, either “sftp” or “ftp”.

Hdr

Specifies the row which is to be considered as the header to retrieve the names of each columns

widths

Sets column widths if the text file data source has a fixed width format. Use -1 for a variable width data source

delimiter

Set a custom field delimiter. When this value is not supplied the default comma delimiter will be used.

skipheaderrows

If the text file contains header rows that need to be skipped. State the number of rows to ignore from the top of the CSV file.

skipfooterrows

If the text file contains footer rows that need to be skipped.

 

The parameters csv, fields/hdr, host, port, workingdirectory and protocol are mandatory in this case and the remaining are optional in a SFTPDataSource connection string.

Example Connection Strings:

csv=book1.csv;fields=Name,CategoryId;hdr=1;host=10.104.101.177;port=22;workingdirectory=/;protocol=sftp

    2.2 Credentials to connect to the remote server will still be entered in the text fields given

           

  2.3 Test Connection and click Save, the SFTPDataSource will be ready for use.

Note: If you are using Ixtransform, please make sure that your SFTP or FTP server allows request from the following IP address:  23.98.66.136, 23.98.66.167, 23.98.66.249, 23.98.64.20

 

Related Articles

Keywords

datasource data source customise