# DownloadFiles

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.SFTP/tree/main/Frends.SFTP.DownloadFiles>

{% tabs %}
{% tab title="Parameter: Source" %}

| Name                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Directory : `String`                    | <p>Directory on the server.</p><p><br>Default: <code>/</code><br>Example: <code>/upload/</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| FileName : `String`                     | <p>File name or file mask of the files to be fetched.</p><p><br>Default: <code>-</code><br>Example: <code>test.txt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| IncludeSubdirectories : `Boolean`       | <p>Determines if subdirectories should be included when searching source files.</p><p>Depending on how many subdirectories there are, this operation can be extremely expensive.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Action : `SourceAction`                 | <p>What to do if source file is not found. Error = alarm and fail,</p><p>Info = alarm info and quit with success status, Ignore = quit</p><p>with success status.</p><p>Possible values:</p><ul><li><code>Error</code>:</li></ul><p>What to do if source file is not found. Error = alarm and fail,</p><p>Info = alarm info and quit with success status, Ignore = quit</p><p>with success status.</p><ul><li><code>Info</code>:</li></ul><p>What to do if source file is not found. Error = alarm and fail,</p><p>Info = alarm info and quit with success status, Ignore = quit</p><p>with success status.</p><ul><li><code>Ignore</code>:</li></ul><p>What to do if source file is not found. Error = alarm and fail,</p><p>Info = alarm info and quit with success status, Ignore = quit</p><p>with success status.</p><p><br>Default: <code>0</code><br>Example: <code>SourceAction.Error</code></p> |
| Operation : `SourceOperation`           | <p>What to do with the source file after transfer.</p><p>Possible values:</p><ul><li><code>Delete</code>:</li></ul><p>What to do with the source file after transfer.</p><ul><li><code>Rename</code>:</li></ul><p>What to do with the source file after transfer.</p><ul><li><code>Move</code>:</li></ul><p>What to do with the source file after transfer.</p><ul><li><code>Nothing</code>:</li></ul><p>What to do with the source file after transfer.</p><p><br>Default: <code>0</code><br>Example: <code>SourceOperation.Delete</code></p>                                                                                                                                                                                                                                                                                                                                                           |
| FileNameAfterTransfer : `String`        | <p>Parameter for Rename operation. You can use file macros and also specify a directory</p><p>where to move the files to, e.g. /subdir/%Date%file.txt. If you don't define a</p><p>directory path, the source directory is used. When using rename, this parameter</p><p>must always contain a file name.</p><p><br>Default: <code>-</code><br>Example: <code>transferred.txt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| DirectoryToMoveAfterTransfer : `String` | <p>Parameter for Move operation. Set the full path to the directory without the file name. You can use some macros in the directory name, e.g. /subdir/%Year%\_uploaded/.</p><p><br>Default: <code>-</code><br>Example: <code>/upload/transferred/</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| FilePaths : `Object`                    | <p>The paths to the files to transfer, mainly meant to be used with the file trigger with the syntax: #trigger.data.filePaths</p><p><br>Default: <code>-</code><br>Example: <code>#trigger.data.filePaths</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| {% endtab %}                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

{% tab title="Parameter: Destination" %}

| Name                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Directory : `String`                   | <p>Local directory where files are to be transferred.</p><p><br>Default: <code>/</code><br>Example: <code>C:\directory\</code></code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| FileName : `String`                    | <p>File name of the destination file with possible macros.</p><p><br>Default: <code>-</code><br>Example: <code>test.txt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| FileNameEncoding : `FileEncoding`      | <p>If set, this ecoding will be used to encode and decode command</p><p>parameters and server responses, such as file names.</p><p>By selecting 'Other' you can use any encoding.</p><p>Possible values:</p><ul><li><code>UTF8</code>:</li></ul><p>If set, this ecoding will be used to encode and decode command</p><p>parameters and server responses, such as file names.</p><p>By selecting 'Other' you can use any encoding.</p><ul><li><code>ANSI</code>:</li></ul><p>If set, this ecoding will be used to encode and decode command</p><p>parameters and server responses, such as file names.</p><p>By selecting 'Other' you can use any encoding.</p><ul><li><code>ASCII</code>:</li></ul><p>If set, this ecoding will be used to encode and decode command</p><p>parameters and server responses, such as file names.</p><p>By selecting 'Other' you can use any encoding.</p><ul><li><code>WINDOWS1252</code>:</li></ul><p>If set, this ecoding will be used to encode and decode command</p><p>parameters and server responses, such as file names.</p><p>By selecting 'Other' you can use any encoding.</p><ul><li><code>Other</code>:</li></ul><p>If set, this ecoding will be used to encode and decode command</p><p>parameters and server responses, such as file names.</p><p>By selecting 'Other' you can use any encoding.</p><p><br>Default: <code>1</code><br>Example: <code>FileEncoding.ANSI</code></p> |
| EnableBomForFileName : `Boolean`       | <p>Additional option for UTF-8 encoding to enable bom.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| FileNameEncodingInString : `String`    | <p>File encoding to be used. A partial list of possible encodings: <https://en.wikipedia.org/wiki/Windows_code_page#List>.</p><p><br>Default: <code>-</code><br>Example: <code>utf-8</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Action : `DestinationAction`           | <p>Operation to determine what to do if destination file exists.</p><p>Possible values:</p><ul><li><code>Append</code>:</li></ul><p>Operation to determine what to do if destination file exists.</p><ul><li><code>Overwrite</code>:</li></ul><p>Operation to determine what to do if destination file exists.</p><ul><li><code>Error</code>:</li></ul><p>Operation to determine what to do if destination file exists.</p><p><br>Default: <code>2</code><br>Example: <code>DestinationAction.Error</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| AddNewLine : `Boolean`                 | <p>If enabled new line is added to the existing file before appending the content.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| FileContentEncoding : `FileEncoding`   | <p>Encoding for the appending content. By selecting 'Other' you can use any encoding.</p><p>Possible values:</p><ul><li><code>UTF8</code>:</li></ul><p>Encoding for the appending content. By selecting 'Other' you can use any encoding.</p><ul><li><code>ANSI</code>:</li></ul><p>Encoding for the appending content. By selecting 'Other' you can use any encoding.</p><ul><li><code>ASCII</code>:</li></ul><p>Encoding for the appending content. By selecting 'Other' you can use any encoding.</p><ul><li><code>WINDOWS1252</code>:</li></ul><p>Encoding for the appending content. By selecting 'Other' you can use any encoding.</p><ul><li><code>Other</code>:</li></ul><p>Encoding for the appending content. By selecting 'Other' you can use any encoding.</p><p><br>Default: <code>1</code><br>Example: <code>FileEncoding.ANSI</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| FileContentEncodingInString : `String` | <p>File encoding to be used. A partial list of possible encodings: <https://en.wikipedia.org/wiki/Windows_code_page#List>.</p><p><br>Default: <code>-</code><br>Example: <code>utf-8</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| EnableBomForContent : `Boolean`        | <p>Additional option for UTF-8 encoding to enable bom.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| {% endtab %}                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

{% tab title="Parameter: Connection" %}

| Name                                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ConnectionTimeout : `Int32`                      | <p>The lenght of time, in seconds, until the connection times out.</p><p>You can use value -1 to indicate that the connection does not time out.</p><p>Default value is 60 seconds.</p><p><br>Default: <code>60</code><br>Example: <code>60</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| KeepAliveInterval : `Int32`                      | <p>The keep-alive interval in milliseconds. Interval the client send keep-alive packages to the host.</p><p>You can use value -1 to disable the keep-alive.</p><p><br>Default: <code>-1</code><br>Example: <code>-1</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Address : `String`                               | <p>SFTP host address</p><p><br>Default: <code>-</code><br>Example: <code>localhost</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Port : `Int32`                                   | <p>Port number to use in the connection to the server.</p><p><br>Default: <code>22</code><br>Example: <code>22</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Authentication : `AuthenticationType`            | <p>Selection for authentication type</p><p>Possible values:</p><ul><li><code>UsernamePassword</code>:</li></ul><p>Selection for authentication type</p><ul><li><code>UsernamePrivateKeyFile</code>:</li></ul><p>Selection for authentication type</p><ul><li><code>UsernamePrivateKeyString</code>:</li></ul><p>Selection for authentication type</p><ul><li><code>UsernamePasswordPrivateKeyFile</code>:</li></ul><p>Selection for authentication type</p><ul><li><code>UsernamePasswordPrivateKeyString</code>:</li></ul><p>Selection for authentication type</p><p><br>Default: <code>-</code><br>Example: <code>AuthenticationType.UsernamePassword</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| UserName : `String`                              | <p>Username to use for authentication to the server. Note that the file endpoint only supports</p><p>username for remote shares and the username must be in the format DOMAIN\Username.</p><p><br>Default: <code>-</code><br>Example: <code>foo</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 🗝Password : `String`                            | <p>Password to use in the authentication to the server.</p><p><br>Default: <code>-</code><br>Example: <code>pass</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| PrivateKeyFile : `String`                        | <p>Full path to private key file.</p><p><br>Default: <code>-</code><br>Example: <code>C:\path\to\private\key</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 🗝PrivateKeyString : `String`                    | <p>Private key as a string, supported private key formats: OpenSSH and ssh.com.</p><p>PuTTY keys can be converted with puttygen.exe application.</p><p>1. Load your key file into puttygen.exe</p><p>2. Conversion > Export OpenSSH key (not the "force new file format" option)</p><p><br>Default: <code>-</code><br>Example: <code>-----BEGIN RSA PRIVATE KEY----- Fqxq2jbSKyb0a+oW96Tjoif3Kcb5zZ0FiQyiHgQozLXrecjdUwjWuedkDoZMxwG5 bxpOnxZ/88tDzYCtCPcYCPRF8BNueUsZO8/tztTra+4NgVd/omXHG5bqb7iMB4dc ... OX7Q/wO4lqOlFhLtRnSL0cfuhRmt59pM75Zd+euX5tv9jmCj+AQT/kiBoMhNrDGk N2gTujnH7HCr/afSBeL3xnYcEmeCQTxTPZofBjPC+TPd9g7MntSGBeU/Fstv0jbg -----END RSA PRIVATE KEY-----</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| 🗝PrivateKeyPassphrase : `String`                | <p>Passphrase for the private key file.</p><p><br>Default: <code>-</code><br>Example: <code>passphrase</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ServerFingerPrint : `String`                     | <p>Fingerprint of the SFTP server. When using "Username-Password"</p><p>authentication it is recommended to use server fingerprint in</p><p>order to be sure of the server you are connecting. Supported</p><p>formats for server fingerprints: MD5 and SHA256.</p><p><br>Default: <code>-</code><br>Example: <code>MD5: '41:76:EA:65:62:6E:D3:68:DC:41:9A:F2:F2:20:69:9D' SHA256: 'FBQn5eyoxpAl33Ly0gyScCGAqZeMVsfY7qss3KOM/hY='</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| HostKeyAlgorithm : `HostKeyAlgorithms`           | <p>Host key algorithm to use when connecting to server.</p><p>Default value is Any which doesn't force the task to use</p><p>specific algorithm.</p><p>Possible values:</p><ul><li><code>Any</code>:</li></ul><p>Host key algorithm to use when connecting to server.</p><p>Default value is Any which doesn't force the task to use</p><p>specific algorithm.</p><ul><li><code>RSA</code>:</li></ul><p>Host key algorithm to use when connecting to server.</p><p>Default value is Any which doesn't force the task to use</p><p>specific algorithm.</p><ul><li><code>Ed25519</code>:</li></ul><p>Host key algorithm to use when connecting to server.</p><p>Default value is Any which doesn't force the task to use</p><p>specific algorithm.</p><ul><li><code>Nistp256</code>:</li></ul><p>Host key algorithm to use when connecting to server.</p><p>Default value is Any which doesn't force the task to use</p><p>specific algorithm.</p><ul><li><code>Nistp384</code>:</li></ul><p>Host key algorithm to use when connecting to server.</p><p>Default value is Any which doesn't force the task to use</p><p>specific algorithm.</p><ul><li><code>Nistp521</code>:</li></ul><p>Host key algorithm to use when connecting to server.</p><p>Default value is Any which doesn't force the task to use</p><p>specific algorithm.</p><p><br>Default: <code>0</code><br>Example: <code>HostKeyAlgorithm.RSA</code></p> |
| BufferSize : `UInt32`                            | <p>Integer value of used buffer size as KB.</p><p>Default value is 32 KB.</p><p><br>Default: <code>32</code><br>Example: <code>32</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| UseKeyboardInteractiveAuthentication : `Boolean` | <p>Enable if the server uses keyboard-interactive authentication method.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| PromptAndResponse : `PromptResponse[]`           | <p>Responses for the server prompts when using Keyboard Interactive authentication method.</p><p><br>Default: <code>-</code><br>Example: <code>-</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| {% endtab %}                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |

{% tab title="Parameter: Options" %}

| Name                                            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Timeout : `Int32`                               | <p>Timeout in seconds when the Task is cancelled after.</p><p>Cancellation with the Timeout will stop the operation even if the transfer is occuring.</p><p>Task will try to restore the source file. Destination file will be deleted if the cancellation happens during the transfer.</p><p>Versus to the Connection.ConnectionTimeout which will only timeout the connection to the SFTP server if client is idle.</p><p>Number zero (0) or negative number will disable the timeout.</p><p><br>Default: <code>0</code><br>Example: <code>30</code></p> |
| ThrowErrorOnFail : `Boolean`                    | <p>Should an exception be thrown when file transfer fails.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                          |
| RenameSourceFileBeforeTransfer : `Boolean`      | <p>Should the source file be renamed with temporary file name during file transfer as a locking mechanism.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                          |
| SourceFileExtension : `String`                  | <p>File extension for the temporary source file which is used during the transfer.</p><p><br>Default: <code>.8CO</code><br>Example: <code>.8CO</code></p>                                                                                                                                                                                                                                                                                                                                                                                                  |
| RenameDestinationFileDuringTransfer : `Boolean` | <p>Should the destination file be renamed with temporary file name during file transfer as a locking mechanism.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                     |
| DestinationFileExtension : `String`             | <p>File extension for the temporary destination file which is used during the transfer.</p><p><br>Default: <code>.8CO</code><br>Example: <code>.8CO</code></p>                                                                                                                                                                                                                                                                                                                                                                                             |
| CreateDestinationDirectories : `Boolean`        | <p>Should the destination directories be created if they do not exist. May not work on all servers.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                |
| PreserveLastModified : `Boolean`                | <p>Should the Last Modified timestamp be preserved from the source.</p><p><br>Default: <code>False</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                |
| OperationLog : `Boolean`                        | <p>While enabled all operations logs of executions will be returned with the result.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                |
| {% endtab %}                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

{% tab title="Parameter: Info" %}

| Name                       | Description                                                                                                                                                                                                                                            |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| TransferName : `String`    | <p>Optional descriptive name for the transfer.</p><p>Will be included in the file transfer log</p><p>entries and also in all error messages in the event log.</p><p><br>Default: <code>"SFTPDownload"</code><br>Example: <code>SFTPDownload</code></p> |
| WorkDir : `String`         | <p>Directory where temporary files are stored during transfer.</p><p><br>Default: <code>-</code><br>Example: <code>C:\temp\</code></code></p>                                                                                                          |
| ProcessUri : `String`      | <p>The process URI, use #process.uri</p><p><br>Default: <code>#process.uri</code><br>Example: <code>#process.uri</code></p>                                                                                                                            |
| TaskExecutionID : `String` | <p>Reference to the Task execution id, use #process.executionid</p><p><br>Default: <code>#process.executionid</code><br>Example: <code>#process.executionid</code></p>                                                                                 |
| {% endtab %}               |                                                                                                                                                                                                                                                        |

{% tab title="Result: Result" %}

| Name                                            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ActionSkipped : `Boolean`                       | <p>Boolean value of the skipped Action.<br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Success : `Boolean`                             | <p>Boolean value of the successful transfer.<br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| UserResultMessage : `String`                    | <p>Message of the transfer operations.<br>Example: <code>1 files transferred: test.txt"</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| SuccessfulTransferCount : `Int32`               | <p>Count of files that has been successfully transferred.<br>Example: <code>1</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| FailedTransferCount : `Int32`                   | <p>Count of files that have not been transferred.<br>Example: <code>0</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| TransferredFileNames : `IEnumerable<String>`    | <p>List of transferred file names.<br>Example: <code>\[ "test.txt", "test2.txt" ]</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| TransferErrors : `Dictionary<String, IList`1>\` | <p>Dictionary of file names and errors messages of the failed transfers.<br>Example: <code>{ test.txt : \[ Failure in CheckIfDestinationFileExists: File 'test.txt' could not be transferred to '/upload/Upload'. Error: Unable to transfer file. Destination file already exists: test.txt \[Source file restored.], ] text2.txt : \[ Failure in CheckIfDestinationFileExists: File 'test2.txt' could not be transferred to '/upload/Upload'. Error: Unable to transfer file. Destination file already exists: test2.txt \[Source file restored.], ] }</code></p> |
| TransferredFilePaths : `IEnumerable<String>`    | <p>List of transferred file paths.<br>Example: <code>\[ "/Upload/upload/test.txt", "/Upload/upload/test2.txt" ]</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| TransferredDestinationFilePaths : `String[]`    | <p>List of destination file paths of the transferred files.<br>Example: <code>\[ "C:\test\test.txt", "C:\test\test2.txt" ]</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                              |
| OperationsLog : `IDictionary<String, String>`   | <p>Operations logs for the transfer.<br>Example: <code>{ "2022-05-30 12:27:35.00Z": "FILE LIST C:\test\test.txt" "2022-06-01 11:01:50.40Z": "RenameSourceFileBeforeTransfer: Renaming source file test.txt to temporary file name frends\_637896781104694806az33q4kf.8CO before transfer" }</code></p>                                                                                                                                                                                                                                                             |
| {% endtab %}                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

{% tab title="Changelog" %}

## Changelog

### \[4.0.0] - 2026-04-26

#### Changed

* Drop support for .NET Framework 4.7.1 and .NET Standard 2.0.

### \[3.1.0] - 2026-02-17

#### Fixed

* Fixed the issue with not deleting all temporary files.

### \[3.0.0] - 2026-01-27

#### Changed

**Breaking changes!**

* Updated dependency SSH.NET to the newest version 2025.1.0.
* Drop DSS support

### \[2.18.0] - 2026-01-23

#### Fixed

* Improve error handling to secure against data loss within temporary files.

### \[2.17.0] - 2026-01-22

#### Fixed

* Use safe GUID temp filename to handle source files with Windows-invalid characters

### \[2.16.0] - 2026-01-13

#### Fixed

* Operation timeout is now using the Connection.ConnectionTimeout parameter.

### \[2.15.0] - 2025-10-17

#### Fixed

* Fixed restoring destination file in any case.

### \[2.14.0] - 2024-09-30

#### Fixed

* Fixed small memory leak with CancellationTokenSource by adding dispose to the end of the Task.

### \[2.13.0] - 2024-09-05

#### Fixed

* Fixed issue with certain SFTP servers which did not use IsRegularFile property on files by modifying the logic to check that the file is not anything else than a regular file.

### \[2.12.0] - 2024-08-16

#### Updated

* Updated Renci.SshNet library to version 2024.1.0.

### \[2.11.0] - 2024-04-30

#### Fixed

* Fixed issue were Task threw exception when using macros in Source Directory.

### \[2.10.0] - 2024-03-06

#### Added

* \[Breaking] Added new parameter Source.IncludeSubdirectories which enables source file search from subdirectories.

### \[2.9.1] - 2024-02-22

#### Changed

* Added StyleCop.Analyzers to analyze the Task code.
* Made code changes suggested by the StyleCop.Analyzers.
* Fixed Readme.

### \[2.9.0] - 2023-12-15

#### Added

* \[Breaking] Added new parameter Options.Timeout which will cause the Task to terminate at assigned period of time if enabled.

#### Fixed

* Fixed FileOperations.MoveAsync to remove the moved file.

### \[2.8.0] - 2023-12-05

#### Changed

* \[Breaking] Changed TransferredDestinationFilePaths Result property type from List to string\[].
* Changed SftpClient operations to use async methods with CancellationToken.

#### Added

* Added FileOperations class which handles file operations as async with CancellationToken e.g. Append, Copy, Move.

#### Fixed

* Fixed issue where the Task gets stuck and can't be terminated.

### \[2.7.1] - 2023-09-08

#### Added

* Added SFTPClient.OperationTimeout which should cause timeout during operations if the Task becomes stuck.

### \[2.7.0] - 2023-06-07

#### Added

* \[Breaking] Added new parameter for keyboard-interactive authentication where users can add prompts and responses.
* Modified operations log to list current system and sftp server information.

#### Fixed

* Modified private key passphrase to be visible when all private key authentication options were enabled.
* Fixed operations log to show case exceptions more precisely.

### \[2.6.1] - 2023-05-17

#### Fixed

* Fixed issue with TransferredFileNames was incorrect when FilePaths parameter was used.

### \[2.6.0] - 2023-05-16

#### Added

* Added new result attribute TransferredDestinationFilePaths list consisting of the destination file paths.

### \[2.5.4] - 2023-02-14

#### Added

* Re-enabled key exchange algorithms 'curve25519-sha256' and '<curve25519-sha256@libssh.org>'.

### \[2.5.3] - 2023-02-08

#### Fixed

* Fixed issue with file not found when downloading from server when server has automatic delete action enabled.

### \[2.5.2] - 2023-01-31

#### Added

* Added cancellation token to the method listing the source files so Task won't freeze in that execution.

### \[2.5.1] - 2022-12-30

#### Fixed

* Fixed issue with empty source dir throws an exception by setting empty source directory as '/'.
* Fixed issue with when no source files userResultMessage still said no. files transferred and not no files transferred.

### \[2.5.0] - 2022-12-16

#### Fixed

* \[Breaking] Fixed issue where keepaliveinterval and operationtimeout is set as the connectiontimeout by creating them for the keepaliveinterval its own parameter and removed operationtimeout.

### \[2.4.2] - 2022-12-01

#### Updated

* Updated dependencies System.Text.Encoding.CodePages and Microsoft.Extensions.DependencyInjection to the newest version.
* Modified test to run against net471 instead of net6.

### \[2.4.1] - 2022-11-24

#### Fixed

* Fixed issue with files not found when the name consist of special characters by adding a check for the files exact name.

### \[2.4.0] - 2022-11-03

#### Added

* \[Breaking] Added parameters for the file extension of temporary source and destination files when rename options are enabled.
* Fixed task to enable transfers with file paths.
* Fixed operations log to show correct state when source files are not found with filePaths.
* Fixed operations log to use temp work path when getting source files to temp directory.
* Added tests for the filePaths.
* Modified tests to not use physical files but to create them during test run.

### \[2.3.0] - 2022-10-12

#### Added

* Added boolean parameter for adding a new line when appending to an existing file.
* Changed the appending to use AppendAllText instead of AppendAllLines.

### \[2.2.3] - 2022-10-12

#### Fixed

* Fixed OperationTimeout and KeepAliveInterval attributes to use directly user input.

### \[2.2.2] - 2022-10-03

#### Added

* Added OperationTimeout and KeepAliveInterval attributes to SftpClient and set them to same value as the ConnectionTimeout parameter.

### \[2.2.1] - 2022-09-30

#### Fixed

* Added possibility to give different directory to the task when using SourceOperation.Rename.
* Updated documentation.

### \[2.2.0] - 2022-09-26

#### Fixed

* \[Breaking] Added option to enable keyboard-interactive authentication method. This change will break the automatic updates of the task.
* Fixed issue with connecting to server which uses keyboard-interactive authentication method. Fixed by adding UseKeyboardInteractiveAuthentication parameter and handled the method inside tha task.

### \[2.1.2] - 2022-09-23

#### Fixed

* Fixed issue with the error message by changing how the error message is build. Error message had 'SFTP://' in both endpoints.

### \[2.1.1] - 2022-09-16

#### Fixed

* Fixed error handler by adding connection check to FileTransporter and SingleFileTransfer classes. If the client is not connected the task tries to connect again before handling errors.

### \[2.1.0] - 2022-09-09

#### Fixed

* \[Beaking] Removed UTF-16 and Unicode FileEncoding because their implementation didn't work. These were used as a parameter so autoupdate won't work.
* Fixed how the Encoding on windows-1252 is handled. Added NuGet System.Text.Encoding.CodePages which can handle that encoding.
* Fixed error handling by adding catch to FileTransporter to catch SftpPathNotFoundException and general Exception.
* Added tests to test the file name and content encoding.
* Updated the document to state that Ssh.Net only supports private keys in OpenSSH and ssh.com formats.
* Added documentation on the private key formatingm from putty.ppk to OpenSSH.
* Fixed HostKeyAlgorithm by removing the forcing of the ssh-rsa.
* Added HostKeyAlgorithm parameter which enables users to change the host key algorithm used in the task. Before task defaults to ED25519.
* Added enum HostKeyAlgorithms with the supported algorithms.
* Modified tests to create testfiles instead of using files from project directory.

### \[2.0.3] - 2022-08-19

#### Fixed

* Fixed issue with server fingerprint given by user in SHA256 hex format was not accepted: Added conversion to the fingerprint given by user.
* Fixed issue when using invalid server fingerprint in MD5 string format throws wrong error message: Added more specific error messages.
* Changed how MD5 string is handled. MD5 can now be given without ':' or '-' characters.
* Fixed issue that Sha256 was only accepted in Base64 format: Added support for Sha256 in hex format.
* Changed the used HostKeyAlgorithm by forcing to use ssh-rsa default was ed25519.
* Added more tests for using server fingerprints.

### \[2.0.2] - 2022-08-10

#### Fixed

* Fixed issue where when using Rename options and appending / overwrite the task would throw an exception because the work directory given by user was used with renaming destination file.
* Added error message if a file with the same name as source file exists in DirectoryToMoveAfterTransfer.
* Fixed issue where when using SourceOperation.Move the source file cannot be restored when exception occurs.
* Fixed issue that if SourceOperation is ignore and no source files were found no operations log is created.
* Removed FileEncoding UTF-16 which was not implemented and threw exception if selected.

### \[2.0.1] - 2022-07-18

#### Fixed

* Fixed issue with task throwing exception when no source files found and source action info or ignore selected.

### \[2.0.0] - 2022-07-15

#### Fixed

* \[Breaking] Changed the implementation to work similar to Cobalt by moving the source file to local Temp folder before transfering to destination.
* Fixed issue where PreserveModified caused exceptions because the method used wrong file path.
* Fixed bug where source files were deleted if RenameSourceFileBeforeTransfer was enabled and SourceOperation.Move had directory that didn't exist.'
* Added logger usage in places where it was needed to make the operations log and error info more informative.
* Modified the logger usage that the logger.NotifyInformation is done after the action so it's easier to see where errors has occurred.

### \[1.0.4] - 2022-06-30

#### Fixed

* Fixed issue where '.' and '..' directories were also fetched when using '\*' character as source file mask.
* Added check for GetSourceFiles so that only files are fetched and not directories.
* Updated Microsoft.Extension.DependencyInjection library.

### \[1.0.3] - 2022-06-29

#### Fixed

* Fixed issue with forward slash being added to the source directory.

### \[1.0.2] - 2022-06-15

#### Fixed

* Fixed issue with download failes when RenameDestinationFileDuringTransfer was enabled and destination file existed.
* Added tests to test the issue.

### \[1.0.1] - 2022-06-13

#### Fixed

* Fixed Source Operations removed source file when RenameSourceFileBeforeTransfer was enabled and transfer failed.
* Fixed Destination file being removed when RenameDestinationFileDuringTransfer was enabled and transfer failed.
* Removed permission changes to destination file.
* Fixed documentation.

### \[1.0.0] - 2022-06-03

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
