Download File with FTP
  • 27 Jul 2022
  • 2 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Download File with FTP

  • Dark
    Light

Article summary

Overview

File Transfer Protocol (FTP) is a method for transferring files across a network. Some FTP servers allow an anonymous connection, but many require a user name and password for the FTP server when connecting. A Flow can be used to download a file from an FTP server once the authentication information has been specified. The FTP 'Download' step has additional settings that can used for specific situations. These are the following configuration:

Setting NamePurpose
Get Configuration From DataAllows the FTP Host name 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

In this example, build a flow that will download a file from an FTP server. Begin by navigating to a Designer Folder, select the 'Create Flow' button. Name the Flow and select 'Create'.

2018-09-12_144653.png


To add the FTP Download step, in the Steps panel, expand the category Integrations > FTP, and drag the step onto the flow canvas.

The Download step connects to the FTP server and looks for a file to download using the settings configured below. In some cases, there may not be a file to download. To handle this situation the step has two outcomes: Found and Not Found. Connect both of these paths to the End step to ensure the flow ends regardless if there is a file to download.
2018-09-16_144808.png

Next, configure the settings for the Download step by selecting it in the workspace and configuring it in the Properties panel.
In the FTP > Server > Authentication section, complete the Username and Password fields for the account that will connect to the FTP server.
In the Host field, enter the FTP Server Hostname.


  1. In the section Inputs > Output FileName, select Constant from the Mapping Type drop-down list.
  2. In the Value field, enter the name for the file on the FTP server that should be downloaded.
  3. In the Remote File Path section, in the Value field, enter the pathname on the FTP server where files should be downloaded from.
  4. In the section Outputs > Found > File, in the Name field, enter a name for the file once it is downloaded.

The Remote File Path should have the full file path, after the hostname, indicated in this field.

In addition, the Output File Name field allows designers to change the output name of the file once downloaded. If a user wishes to not rename this file in the flow, then the current setup is fine.

 

Debug


This completes the flow. Save it and run it in the Debugger. The FTP request is sent, and there is a pause as the file is downloaded.

A file is found in the FTP location and is downloaded successfully using the settings in the flow. The file that's been downloaded exists in memory and flow data, not in any local file system. Learn how to write the file to the file system.




Was this article helpful?