# UploadFiles

Required Frends version: 5.1+

Required .NET version: 471, 6.0, standard2.0

Compatible Agents: Legacy, Crossplatform

Source code:

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

| Name                                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Directory : `String`                    | <p>Source directory.</p><p><br>Default: <code>/</code><br>Example: <code>C:\sourcefiles</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>my\_files\*.txt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| NotFoundAction : `SourceNotFoundAction` | <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>SourceNotFoundAction.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. Set the file name for the source file.</p><p><br>Default: <code>-</code><br>Example: <code>%SourceFileName%%SourceFileExtension%</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| DirectoryToMoveAfterTransfer : `String` | <p>Parameter for Move operation. Set the full file path for source file.</p><p><br>Default: <code>-</code><br>Example: <code>c:\movedFiles</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>Directory on the server.</p><p><br>Default: <code>/</code><br>Example: <code>/somedir</code></p>                                                                                                                                                                                                                                                                                                                                                                                                            |
| FileName : `String`          | <p>File name of the destination file with possible macros.</p><p><br>Default: <code>-</code><br>Example: <code>myFile%Year%.txt</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> |
| {% endtab %}                 |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

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

| Name                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Address : `String`                     | <p>FTP(S) host address</p><p><br>Default: <code>-</code><br>Example: <code>my.ftp.server.com</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Port : `Int32`                         | <p>Port number to use in the connection to the server.</p><p><br>Default: <code>21</code><br>Example: <code>21</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>myUsername</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 🗝Password : `String`                  | <p>Password to use in the authentication to the server.</p><p><br>Default: <code>-</code><br>Example: <code>myPassword</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| TransportType : `FtpTransportType`     | <p>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</p><p>Possible values:</p><ul><li><code>Binary</code>:</li></ul><p>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</p><ul><li><code>Ascii</code>:</li></ul><p>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</p><p><br>Default: <code>0</code><br>Example: <code>FtpTransportType.Binary</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Mode : `FtpMode`                       | <p>Connection mode to use to connect to the FTP server</p><p>Possible values:</p><ul><li><code>Passive</code>:</li></ul><p>Connection mode to use to connect to the FTP server</p><ul><li><code>Active</code>:</li></ul><p>Connection mode to use to connect to the FTP server</p><p><br>Default: <code>0</code><br>Example: <code>FtpMode.Passive</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| KeepConnectionAliveInterval : `Int32`  | <p>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</p><p><br>Default: <code>0</code><br>Example: <code>60</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ConnectionTimeout : `Int32`            | <p>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</p><p><br>Default: <code>60</code><br>Example: <code>60</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Encoding : `String`                    | <p>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</p><p><br>Default: <code>-</code><br>Example: <code>utf-8</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| BufferSize : `Int32`                   | <p>Integer value of used buffer size as bytes.</p><p>Default value is 4 KB.</p><p><br>Default: <code>4096</code><br>Example: <code>4096</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| VerifyOption : `VerifyOptions`         | <p>If set, Task will do checksum check for the transferred file after the transfer. If the checksum fails Task can be configured to retry the transfer.</p><p>If Checksum fails the transferred file is removed and Task will throw an error, because the content is most likely corrupted.</p><p>Possible values:</p><ul><li><code>None</code>:</li></ul><p>If set, Task will do checksum check for the transferred file after the transfer. If the checksum fails Task can be configured to retry the transfer.</p><p>If Checksum fails the transferred file is removed and Task will throw an error, because the content is most likely corrupted.</p><ul><li><code>Retry</code>:</li></ul><p>If set, Task will do checksum check for the transferred file after the transfer. If the checksum fails Task can be configured to retry the transfer.</p><p>If Checksum fails the transferred file is removed and Task will throw an error, because the content is most likely corrupted.</p><ul><li><code>Throw</code>:</li></ul><p>If set, Task will do checksum check for the transferred file after the transfer. If the checksum fails Task can be configured to retry the transfer.</p><p>If Checksum fails the transferred file is removed and Task will throw an error, because the content is most likely corrupted.</p><p><br>Default: <code>0</code><br>Example: <code>VerifyOptions.None</code></p> |
| RetryAttempts : `Int32`                | <p>Value for how many retries the Task will do while uploading the file.</p><p>Task will check the checksum of the file and based on that retries if necessary.</p><p><br>Default: <code>3</code><br>Example: <code>5</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| UseFTPS : `Boolean`                    | <p>Whether to use FTPS or not.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| SecureDataChannel : `Boolean`          | <p>Whether the data channel is secured or not.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| SslMode : `FtpsSslMode`                | <p>Specifies whether to use Explicit or Implicit SSL</p><p>Possible values:</p><ul><li><code>None</code>:</li></ul><p>Specifies whether to use Explicit or Implicit SSL</p><ul><li><code>Explicit</code>:</li></ul><p>Specifies whether to use Explicit or Implicit SSL</p><ul><li><code>Implicit</code>:</li></ul><p>Specifies whether to use Explicit or Implicit SSL</p><ul><li><code>Auto</code>:</li></ul><p>Specifies whether to use Explicit or Implicit SSL</p><p><br>Default: <code>0</code><br>Example: <code>FtpsSslMode.None</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| EnableClientAuth : `Boolean`           | <p>If enabled the client certificate is searched from user's certificate store</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ClientCertificateName : `String`       | <p>Optional. Enables certification search by name from the certification store of current user.</p><p><br>Default: <code>-</code><br>Example: <code>mycert.crt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ClientCertificateThumbprint : `String` | <p>Optional. Enables certification search by thumbprint from the certification store of current user.</p><p><br>Default: <code>-</code><br>Example: <code>a909502dd82ae41433e6f83886b00d4277a32a7b</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ValidateAnyCertificate : `Boolean`     | <p>If enabled the any certificate will be considered valid.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ClientCertificatePath : `String`       | <p>Path to client certificate (X509).</p><p><br>Default: <code>-</code><br>Example: <code>c:\example.cer</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| CertificateHashStringSHA1 : `String`   | <p>Certificate SHA1 hash string to validate against.</p><p><br>Default: <code>-</code><br>Example: <code>D911262984DE9CC32A3518A1094CD24249EA5C49</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| {% endtab %}                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

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

| Name                                            | Description                                                                                                                                                                            |
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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 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> |
| 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> |
| 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>false</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>false</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>"FTPUpload"</code><br>Example: <code>FTP Upload</code></p> |
| WorkDir : `String`         | <p>Directory where temporary files are stored during transfer.</p><p><br>Default: <code>-</code><br>Example: <code>c:\workDir</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>True if action was skipped, otherwise false.<br>Example: <code>false</code></p>                                                                                                                          |
| Success : `Boolean`                             | <p>True if the transfer was successful, otherwise false.<br>Example: <code>false</code></p>                                                                                                                 |
| UserResultMessage : `String`                    | <p>Message of the transfer operations containing a simple representation of what happened in the task.<br>Example: <code>1 files transferred: file1.txt</code></p>                                          |
| SuccessfulTransferCount : `Int32`               | <p>Count of files that has been successfully transferred.<br>Example: <code>16</code></p>                                                                                                                   |
| FailedTransferCount : `Int32`                   | <p>Count of files that have not been transferred.<br>Example: <code>2</code></p>                                                                                                                            |
| TransferredFileNames : `IEnumerable<String>`    | <p>List of transferred file names.<br>Example: <code>\[ "file1.txt", "file2.txt" ]</code></p>                                                                                                               |
| TransferErrors : `Dictionary<String, IList`1>\` | <p>Dictionary of file names and errors messages of the failed transfers.<br>Example: <code>{ { "file1.txt", \[ "error1", "error2" ] }, { "file2.txt", \[ "error1", "error2" ] } }</code></p>                |
| TransferredFilePaths : `IEnumerable<String>`    | <p>List of transferred file paths.<br>Example: <code>\[ "C:\dir\file1.txt", "C:\dir\file2.txt" ]</code></p>                                                                                                 |
| OperationsLog : `IDictionary<String, String>`   | <p>Operations logs for the transfer.<br>Example: <code>{ { "2022-05-31 16.21.39.00Z", "operation1" }, { "2022-05-31 16.22.39.00Z", "operation2" }, { "2022-05-31 16.23.39.00Z", "operation3" } }</code></p> |
| {% endtab %}                                    |                                                                                                                                                                                                             |
| {% endtabs %}                                   |                                                                                                                                                                                                             |
