// This module is included in these assemblies:
// as_connecting-to-ftp.adoc

[id='creating-ftp-connections_{context}']
= Creating an FTP or SFTP connection

In an integration, to download or upload files from/to an FTP or SFTP server, 
create a connection to that FTP or SFTP server. You can add the same 
connection to any number of integrations. 

.Prerequisite
You must know the host name of the server you want to connect to. 

.Procedure

. In {prodname}, in the left panel, click *Connections* to
display any available connections.
. Click *Create Connection* to display
{prodname} connectors.
. To create a connection that uses 
File Transfer Protocol, click the *FTP* connector. 
+
Or, to create a connection
that uses Secure File Transfer Protocol, 
click the *SFTP* connector.
. Configure the connection. 
+
* For an FTP connection:
** *Host* is the only parameter that you must
specify. Enter the host name of the server that you want to connect to.
For example, if the name of your FTP host is `FTP.WEST`, then you would 
enter exactly that, `FTP.WEST`. Do not specify the protocol, for example,
you should not specify something like this: `ftp://FTP.WEST`.
** *Port* is required and has a default value of `21`. This is the
port that the FTP server is listening on. 
** All other parameters are either not required or have default values.
The defaults are suitable for most integrations. Descriptions of these 
parameters are after this procedure. 

* For an SFTP connection, there must be values for these parameters:
+
** *Host* is the host name of the SFTP server that you 
want to connect to. For example, if the name of your SFTP host 
is `SFTP.EAST`, then you would 
enter exactly that, `SFTP.EAST`. Do not specify the protocol, for example,
you should not specify something like this: `sftp://SFTP.EAST`.
** *Port* has a default of `22`. This is the port that the SFTP server
is listening on. 
** *User name* of the account that you want to 
use to access the SFTP server.
** *Password* that is associated with that user name.
** All other parameters have default values. The defaults are suitable 
for most integrations. Descriptions of these 
parameters are after this procedure. 

. Click *Validate*. {prodname} immediately tries to validate the
connection and displays a message that indicates whether or not
validation is successful. If validation fails, revise the configuration
details as needed and try again.
. When validation is successful, click *Next*.
. In the *Name* field, enter your choice of a name that
helps you distinguish this connection from any other connections.
For example, enter `*XLight FTP Server*`.
. In the *Description* field, optionally enter any information that
is helpful to know about this connection.
. Click *Save* to see that the connection you
created is now available. If you entered the example name, you would
see that *XLight FTP Server* appears as a connection that you can 
choose to add to an integration.

.Descriptions of other parameters

* *Connect timeout* defaults to *10000* milliseconds and 
indicates a maximum wait of 10 seconds to establish 
the connection. If 10 seconds elapse without a connection then
{prodname} waits for the number of milliseconds defined by
*Reconnect delay* and then tries to reconnect. 

* *Reconnect delay* defaults to *1000* milliseconds and indicates the
wait time before trying to reconnect again. 

* *Maximum reconnect attempts* defaults to *3*. {prodname} tries as many as 3 times
to establish a connection.
 
* *Binary file transfer mode* is used by default.  
Select *No* for ASCII transfer mode.

* *Passive connection mode* defaults to *Yes*, which is usually the preferred
mode. In passive mode, the client opens communication channels with the server
as a way to avoid firewall issues. If you select *No* then active mode is
used.

* *Disconnect from the server after use* defaults to *No*. The connection 
remains established after it performs the action. Select *Yes*
if you want to disconnect from the server after the connection
performs the upload or download. 

* *Data timeout* defaults to *30000* milliseconds and indicates the maximum
length of time that {prodname} waits for a reply. 
