Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

DownloadFiles

Download files from an FTP server.

Task version: 2.3.0

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Source : Source

Source file location and transfer options.

Default: - Example: new Source { Directory = "/files", FileName = "*.txt" }

Source.Directory : String

Directory on the server.

Default: - Example: /directory

Source.FileName : String

File name or file mask of the files to be fetched.

Default: - Example: example*.csv

Source.NotFoundAction : SourceNotFoundAction

What to do if source file is not found. Error = alarm and fail,

Info = alarm info and quit with success status, Ignore = quit

with success status.

Possible values:

  • Error: Will log an error in case source files are missing.

  • Info: Will log a notification in case source files are missing.

  • Ignore: Will not log anything and continue execution without any additional actions.

Default: Error Example: SourceNotFoundAction.Error

Source.Operation : SourceOperation

What to do with the source file after transfer.

Possible values:

  • Delete: Will delete files after downloading.

  • Rename: Will rename the files after downloading.

  • Move: Will move the files after downloading.

  • Nothing: Will do nothing to source files after downloading.

Default: Delete Example: SourceOperation.Delete

Source.FileNameAfterTransfer : String

Parameter for Rename operation. Set the file name for the source file.

Default: - Example: %SourceFileName%%SourceFileExtension%

Source.DirectoryToMoveAfterTransfer : String

Parameter for Move operation. Sets the directory to which source files will be moved after transfer.

Default: - Example: /movedFiles

Destination : Destination

Destination directory location and overwrite options.

Default: - Example: new Destination { Directory = "C:\downloads", Action = DestinationAction.Overwrite }

Destination.Directory : String

Directory on the server.

Default: - Example: /somedir

Destination.FileName : String

File name of the destination file with possible macros.

Default: - Example: myFile%Year%.txt

Destination.Action : DestinationAction

Operation to determine what to do if destination file exists.

Possible values:

  • Append: Will either create the file(s) or append content to existing file(s).

  • Overwrite: Will overwrite existing file(s).

  • Error: Will throw an error if destination file(s) already exist.

Default: Error Example: DestinationAction.Error

Info : Info

Optional transfer info such as transfer name, working directory, and process context.

Default: - Example: new Info { TransferName = "MyTransfer" }

Info.TransferName : String

Optional descriptive name for the transfer.

Will be included in the file transfer log

entries and also in all error messages in the event log.

Default: "FTPDownload" Example: FTP Download

Info.WorkDir : String

Directory where temporary files are stored during transfer.

Default: - Example: c:\workDir

Info.ProcessUri : String

The process URI, use #process.uri

Default: #process.uri Example: #process.uri

Info.TaskExecutionID : String

Reference to the Task execution id, use #process.executionid

Default: #process.executionid Example: #process.executionid

Name
Description

Address : String

FTP(S) host address

Default: - Example: my.ftp.server.com

Port : Int32

Port number to use in the connection to the server.

Default: 21 Example: 21

UserName : String

Username to use for authentication to the server. Note that the file endpoint only supports

username for remote shares and the username must be in the format DOMAIN\Username.

Default: - Example: myUsername

🗝Password : String

Password to use in the authentication to the server.

Default: - Example: myPassword

TransportType : FtpTransportType

Type of transfer: 'Ascii' sends files as text and must only be used for sending ASCII text files. 'Binary' (default) sends files as raw data and should be used for sending e.g. UTF-encoded text files

Possible values:

  • Binary: Binary transport.

  • Ascii: ASCII transport.

Default: Binary Example: FtpTransportType.Binary

Mode : FtpMode

Connection mode to use to connect to the FTP server

Possible values:

  • Passive: Passive mode

  • Active: Active mode.

Default: Passive Example: FtpMode.Passive

KeepConnectionAliveInterval : Int32

Sends NOOP command to keep connection alive at specified time-interval in seconds. If set to 0 the connection is not kept alive. Default value is 0

Default: 0 Example: 60

ConnectionTimeout : Int32

The length of time, in seconds, until the connection times out. You can use value 0 to indicate that the connection does not time out. Default value is 60 seconds

Default: 60 Example: 60

Encoding : String

If set, this encoding will be used to encode and decode command parameters and server responses, such as file names. Example values: utf-8, utf-16, windows-1252

Default: - Example: utf-8

BufferSize : Int32

Integer value of used buffer size as bytes.

Default value is 4 KB.

Default: 4096 Example: 4096

UseFTPS : Boolean

Whether to use FTPS or not.

Default: false Example: false

SecureDataChannel : Boolean

Whether the data channel is secured or not.

Default: true Example: false

SslMode : FtpsSslMode

Specifies whether to use Explicit or Implicit SSL

Possible values:

  • None: No encryption (plain text).

  • Explicit: Use explicit encryption.

  • Implicit: Use implicit encryption.

  • Auto: Tries to use FTPS encryption and falls back to plain text FTP.

Default: None Example: FtpsSslMode.None

EnableClientAuth : Boolean

If enabled the client certificate is searched from user's certificate store

Default: false Example: false

ClientCertificateName : String

Optional. Enables certification search by name from the certification store of current user.

Default: - Example: mycert.crt

ClientCertificateThumbprint : String

Optional. Enables certification search by thumbprint from the certification store of current user.

Default: - Example: a909502dd82ae41433e6f83886b00d4277a32a7b

ValidateAnyCertificate : Boolean

If enabled the any certificate will be considered valid.

Default: false Example: false

ClientCertificatePath : String

Path to client certificate (X509).

Default: - Example: c:\example.cer

CertificateHashStringSHA1 : String

Certificate SHA1 hash string to validate against.

Default: - Example: BA7816BF8F01CFEA414140DE5DAE2223B00361A3

Name
Description

ThrowErrorOnFailure : Boolean

Should an exception be thrown when file transfer fails.

Default: True Example: true

ErrorMessageOnFailure : String

Optional custom error message to include when the task fails.

Default: - Example: FTP download failed

RenameSourceFileBeforeTransfer : Boolean

Should the destination file be renamed with temporary file name during file transfer as a locking mechanism.

Default: True Example: true

RenameDestinationFileDuringTransfer : Boolean

Should the destination file be renamed with temporary file name during file transfer as a locking mechanism.

Default: True Example: true

CreateDestinationDirectories : Boolean

Should the destination directories be created if they do not exist. May not work on all servers.

Default: False Example: true

PreserveLastModified : Boolean

Should the Last Modified timestamp be preserved from the source.

Default: False Example: true

OperationLog : Boolean

While enabled all operations logs of executions will be returned with the result.

Default: True Example: true

Task Result

Name
Description

ActionSkipped : Boolean

True if action was skipped, otherwise false. Example: false

Success : Boolean

True if the transfer was successful, otherwise false. Example: false

UserResultMessage : String

Message of the transfer operations containing a simple representation of what happened in the task. Example: 1 file(s) transferred: file1.txt

SuccessfulTransferCount : Int32

Count of files that has been successfully transferred. Example: 16

FailedTransferCount : Int32

Count of files that have not been transferred. Example: 2

TransferredFileNames : IEnumerable<String>

List of transferred file names. Example: [ "file1.txt", "file2.txt" ]

TransferErrors : Dictionary<String, IList1>`

Dictionary of file names and errors messages of the failed transfers. Example: { { "file1.txt", [ "error1", "error2" ] }, { "file2.txt", [ "error1", "error2" ] } }

TransferredFilePaths : IEnumerable<String>

List of transferred file paths. Example: [ "C:\dir\file1.txt", "C:\dir\file2.txt" ]

OperationsLog : IDictionary<String, String>

Operations logs for the transfer. Example: { { "2022-05-31 16.21.39.00Z", "operation1" }, { "2022-05-31 16.22.39.00Z", "operation2" }, { "2022-05-31 16.23.39.00Z", "operation3" } }

Error : Error

Error details when the transfer fails and ThrowErrorOnFailure is false. Null when the transfer succeeds. Example: null

Error.Message : String

Error message describing the failure. Example: FTP transfer failed: Connection refused.

Error.AdditionalInfo : Exception

The exception that caused the failure, if available. Example: System.Exception: Connection refused

Task Changelog

Changelog for Task Frends.FTP.DownloadFiles.

[2.3.0] - 2026-10-15

Changed

  • Improved internal code documentation.

[2.2.0] - 2026-10-14

Changed

  • Updated documentation

[2.1.0] - 2026-08-24

Fixed

  • Fixed XML documentation: corrected <returns> tag to match actual Result class properties, fixed incorrect parameter references in <frendsdocs> and improved <param> descriptions.

[2.0.0] - 2026-07-30

Changed

  • Breaking change: The task method signature has been updated to consolidate the Source, Destination, and Info parameters into a single Input parameter tab. Existing flows using this task will need to be updated to use the new Input parameter structure.

  • Upgraded target framework from net6.0/netstandard2.0/net471 to net8.0.

  • Renamed ThrowErrorOnFail option to ThrowErrorOnFailure for consistency with Frends standards.

  • Added ErrorMessageOnFailure option for a custom error message when the task fails.

  • Added Error property to the task result, containing error details when the transfer fails and ThrowErrorOnFailure is disabled.

  • Updated package metadata: added Company, Product, and updated PackageProjectUrl to https://frends.com/.

[1.3.0] - 2026-04-02

Fixed

  • Fixed: Added missing changelog and restored redirection to source code.

[1.2.0] - 2024-08-23

Changed

  • Updated the Newtonsoft.Json package to version 13.0.3.

[1.1.3] - 2024-01-30

Fixed

  • Fixed bug when using wildcard filemask and no source files were found.

[1.1.2] - 2024-01-16

Improved

  • Improved Operations log by adding more logging steps.

[1.1.1] - 2024-01-04

Added

  • Added setup for FtpClient.ReadTimeout, FtpClient.DataConnectionConnectTimeout and FtpClient.DataConnectionReadTimeout which were all defaulting to 15 seconds.

[1.1.0] - 2023-09-12

Added

  • Added search for local certificates from machine certification store.

  • [Breaking] Added parameters ClientCertificationName and ClientCertificationThumbprint for exclusive search of client certification.

[1.0.4] - 2023-08-08

Changed

  • Moved client.EncryptionMode setting to be done if UseFTPS is enabled.

[1.0.3] - 2022-11-22

Changed

  • Connection.BufferSize documentation update. Value is set as bytes instead of KBs.

  • Removed Connection.ClientCertificatePath's default value.

[1.0.2] - 2022-08-25

Fixed

  • Fixed RestoreModified method to use the whole path of the destination file and not just the name.

  • Fixed logging of successful transfer to use the name of the file and not reference of FileItem class.

[1.0.1] - 2022-06-15

Fixed

  • Added DisplayFormat annotation to the Connection ClientCertificatePath input field.

[1.0.0] - 2022-06-06

Changed

  • Initial implementation

Last updated

Was this helpful?