Download File with SFTP/FTP
  • 14 Sep 2021
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Download File with SFTP/FTP

  • Dark
    Light

Article summary

Overview

File Transfer Protocol (FTP) is a method for transferring files across a network. While certain FTP servers allow an anonymous connection, the majority require a user name and password for the FTP server when connecting. Downloading a file in Decisions with FTP utilizes the Download step shown in the example below.

Another method for transferring files across a network is the Secure File Transfer Protocol (SFTP). These servers are similarly configured to FTP servers by use of the Download by SFTP step instead. A Flow can be used to download a file from an FTP or SFTP server once the authentication information has been specified. 

The following are additional settings the FTP/SFTP Download step has that can be used based on specific situations: 
Setting NamePurpose
Get Configuration From DataAllows the FTP Hostname and Authentication credentials to be mapped in from flow data
File CompressionCompressing the data for network transit, used for very large files
Proxy TypeAllows the user input their FTP environment proxy settings 

Example (FTP)

Downloading via SFTP?
This example's configuration mirrors the process for SFTP except replace the Download step with Download by SFTP.

In the following example, a Flow will be built to download a file from an FTP server. 

  1. Begin by navigating to a Designer Folder, select CREATE FLOW from the Global Action Bar.
  2. In the resulting Create Flow dialog, select and name the default Flow [Download with FTP]. Click CREATE to proceed to the Flow Designer.
  3.  In the Flow Designer, drag and connect a Download step to the Start step and connect both outcomes to the End step from the Toolbox > INTEGRATIONS > FTP.
    In some cases, there may not be a file available for download and connecting both outcomes to the End step allows the Flow to handle this situation by ending.
  4. Next, navigate to the Properties panel of the Download step.
  5. Configure FTP > Server > Host with the hostname of the FTP server.
  6. Configure FTP > Server > Authentication > Username and Password with the credentials for the account that will connect to the FTP server.
  7. Navigate to the Properties panel > INPUTS > Output File Name field and change the input mapping from Unknown to Constant.
  8. In the Output File Name value field, enter the name of the file on the FTP server that will be downloaded.
  9. In the INPUTS > Remote File Path value field, enter the pathname on the FTP server where the files will be downloaded from.
    This value should be input as a full file path after the hostname; for example, /FileData/exampledoc.txt.
  10. Next, in the OUTPUTS > Found > file value field, if desired, enter a new name for the file once it has been successfully downloaded.
  11. Save the Flow.

Debug

  1. Select Debug from the Top Action Bar. 
  2. Click START DEBUGGING.
  3. If a file is found in the FTP location denoted in the Flow, it will be downloaded and added to memory and Flow data, not in a local file system. 
    Please navigate to Writing a File to the Local File System for more information on how to locate the downloaded file.

Was this article helpful?