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

[id='adding-ftp-connection-upload-named_{context}']
= Uploading a named file to an FTP server

In an integration, you can upload a specific file to an FTP server in the middle of a flow or to finish a simple integration. To do this, add an FTP connection to the middle of a flow or as a simple integration’s finish connection.  

.Prerequisites
* You created an FTP connection. 
* You are creating or editing a flow and {prodname} is prompting you
to add to the integration. Or, {prodname} is prompting you to choose a finish connection. 

.Procedure
. On the *Add to Integration* page, click the plus sign where you 
want to add the connection. Skip this step if {prodname} is
prompting you to choose the finish connection. 
. Click the FTP connection that you want to use
to upload files. 
. On the *Choose an action* page, select *UploadNamedFile*.
. In the *FTP directory* field, enter the absolute or relative name of a server directory. At runtime, the connection uploads the named file (that was received from the previous step) to this directory.
. In the *If file exists* field, indicate the behavior when you are 
uploading a file that has the same path and name as a file that is on
the server. Accept the default, *Override*, to overwrite
the file that is on the server with the file that you are uploading. 
Or, select one of the following:
** *Append* adds the content in the file being uploaded to the file
that is on the server. 
** *Fail* throws `GenericFileOperationException`. The integration does
not enter an error state. 
** *Ignore* does not upload the file. The integration continues running
under the assumption that everything is okay.
** *Move* renames one of the files. 
** *TryRename* uploads the file with a temporary name and renames the
file to the desired name. This operation does not check for the 
existence of a file with the desired name, which makes the operation
faster on most servers than when existence checks are done. 
. In the *Temporary file prefix while copying* field, specify a string. 
The connection prepends this string to the name of a file while it is
being uploaded. 
This enables the connection to write to a temporary file on the 
server and then rename that temporary file to have the correct name. 
This is useful for reducing locks when uploading very large files.
. In the *Temporary file name while copying* field, specify a string. 
The connection renames a file being uploaded to have this name 
while it is being uploaded.
This enables the connection to write to a temporary file on the 
server and then rename that temporary file to have the correct name. 
This is useful for reducing locks when uploading very large files.
. Click *Next*. 

.Result
The connection appears in the integration visualization
where you added it. 
