DownloadFile

Estimated reading: 3 minutes 1917 views

This activity helps the user to download the file from the specified directory in the connected SFTP server. It must be used within a scope activity

Properties

INPUT

DestinationPath: *This parameter specifies the directory path where the downloaded file should be placed on the local system.

It accepts input values in “String” datatype. You can either hardcode the values in “String” format or provide the value in String” datatype.

SourcePath: * This parameter specifies the location of the file on the SFTP server that needs to be fetched for downloading. 

It accepts input values in “String” datatype. You can either hardcode the values in “String” format or provide the value in String” datatype.

MISC

DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnError: Specify the “Boolean” value as “True” or “False.”

True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It indicates the version of the feature being used.

OUTPUT

Result: It provides the ability to view the execution status of the activity. It returns values in “Boolean.”
True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown.

Represents mandatory fields to execute the workflow

Here’s an example of how the activity is used in the workflow:

In the following example, we check if the specified directory exists on the SFTP server. I have used our SFTP server for this demonstration, but you can automate it with your own SFTP server.

1. Create a solution as “Backup”.
2. Install the “SFTP” feature from the “Manage Features” option.
3. Drag and drop the “SFTP Scope” activity into the workflow and set it as the start node.
a. This activity will authenticate the provided credentials and establish a connection to the SFTP server.
b. Enter the SFTP credentials, including the “Host Name,” “User Name,” and “Password,” in their respective fields.
4. Add the “DownloadFile” into the body of the “Sftp Scope” activity.
a. Provide the “SourcePath” in the property as the path from the SFTP server. Here it is as “/SampleTest/output.txt”.
b. Next in the “DestinationPath” property, provide a path to where the file needs to be stored in the local system
c. Here it is as “C:\Users\user\Desktop\SFTP”.
5. Now, save and execute the workflow.

The bot will download the file and store in the specified location in the local file system.

Share this Doc

DownloadFile

Or copy link

CONTENTS