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

MoveFile

Moves files in SFTP server.

Task version: 2.0.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Task Parameters

Name
Description

Directory : String

Source directory.

Default: / Example: /source

Pattern : String

Pattern to match for files. The file mask uses regular expressions, but for convenience, it has special handling for * and ? wildcards.

Default: *.xml Example: /destination

TargetDirectory : String

Target directory where the found files should be copied to.

Default: / Example: /destination

IfTargetFileExists : FileExistsOperation

Operation for if the transferred file exists in destination.

Possible values:

  • Throw: Operation for if the transferred file exists in destination.

  • Rename: Operation for if the transferred file exists in destination.

  • Overwrite: Operation for if the transferred file exists in destination.

Default: 0 Example: FileExistsOperation.Throw

CreateTargetDirectories : Boolean

Enables the Task to create the target directories.

Default: True Example: true

FileEncoding : FileEncoding

Encoding for the read content.

By selecting 'Other' you can use any encoding.

Possible values:

  • UTF8: Encoding for the read content.

By selecting 'Other' you can use any encoding.

  • ANSI: Encoding for the read content.

By selecting 'Other' you can use any encoding.

  • ASCII: Encoding for the read content.

By selecting 'Other' you can use any encoding.

  • WINDOWS1252: Encoding for the read content.

By selecting 'Other' you can use any encoding.

  • Other: Encoding for the read content.

By selecting 'Other' you can use any encoding.

Default: 1 Example: FileEncoding.ANSI

EnableBom : Boolean

Additional option for UTF-8 encoding to enable bom.

Default: False Example: true

EncodingInString : String

File encoding to be used.

Encoding don't support any unicode encoding. It only support the code page encodings.

A partial list of possible encodings: https://en.wikipedia.org/wiki/Windows_code_page#List.

Default: - Example: utf-8

Name
Description

ConnectionTimeout : Int32

The lenght of time, in seconds, until the connection times out.

You can use value -1 to indicate that the connection does not time out.

Default value is 60 seconds.

Default: 60 Example: 60

KeepAliveInterval : Int32

The keep-alive interval in milliseconds. Interval the client send keep-alive packages to the host.

You can use value -1 to disable the keep-alive.

Default: -1 Example: -1

Address : String

SFTP host address

Default: - Example: localhost

Port : Int32

Port number to use in the connection to the server.

Default: 22 Example: 22

Authentication : AuthenticationType

Selection for authentication type

Possible values:

  • UsernamePassword: Selection for authentication type

  • UsernamePrivateKeyFile: Selection for authentication type

  • UsernamePrivateKeyString: Selection for authentication type

  • UsernamePasswordPrivateKeyFile: Selection for authentication type

  • UsernamePasswordPrivateKeyString: Selection for authentication type

Default: - Example: AuthenticationType.UsernamePassword

Username : String

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

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

Default: - Example: foo

🗝Password : String

Password to use in the authentication to the server.

Default: - Example: pass

PrivateKeyFile : String

Full path to private key file. Supported private key formats: OpenSSH and ssh.com.

PuTTY keys can be converted with puttygen.exe application.

1. Load your key file into puttygen.exe

2. Conversion > Export OpenSSH key (not the "force new file format" option)

Default: - Example: C:\path\to\private\key

🗝PrivateKeyString : String

Private key as a string, supported private key formats: OpenSSH and ssh.com.

PuTTY keys can be converted with puttygen.exe application.

1. Load your key file into puttygen.exe

2. Conversion > Export OpenSSH key (not the "force new file format" option)

Default: - Example: -----BEGIN RSA PRIVATE KEY----- Fqxq2jbSKyb0a+oW96Tjoif3Kcb5zZ0FiQyiHgQozLXrecjdUwjWuedkDoZMxwG5 bxpOnxZ/88tDzYCtCPcYCPRF8BNueUsZO8/tztTra+4NgVd/omXHG5bqb7iMB4dc ... OX7Q/wO4lqOlFhLtRnSL0cfuhRmt59pM75Zd+euX5tv9jmCj+AQT/kiBoMhNrDGk N2gTujnH7HCr/afSBeL3xnYcEmeCQTxTPZofBjPC+TPd9g7MntSGBeU/Fstv0jbg -----END RSA PRIVATE KEY-----

🗝PrivateKeyPassphrase : String

Passphrase for the private key file.

Default: - Example: passphrase

ServerFingerPrint : String

Fingerprint of the SFTP server. When using "Username-Password"

authentication it is recommended to use server fingerprint in

order to be sure of the server you are connecting.

Default: - Example: MD5: '41:76:EA:65:62:6E:D3:68:DC:41:9A:F2:F2:20:69:9D' SHA256: 'FBQn5eyoxpAl33Ly0gyScCGAqZeMVsfY7qss3KOM/hY='

HostKeyAlgorithm : HostKeyAlgorithms

Host key algorithm to use when connecting to server.

Default value is Any which doesn't force the task to use

specific algorithm.

Possible values:

  • Any: Host key algorithm to use when connecting to server.

Default value is Any which doesn't force the task to use

specific algorithm.

  • RSA: Host key algorithm to use when connecting to server.

Default value is Any which doesn't force the task to use

specific algorithm.

  • Ed25519: Host key algorithm to use when connecting to server.

Default value is Any which doesn't force the task to use

specific algorithm.

  • nistp256: Host key algorithm to use when connecting to server.

Default value is Any which doesn't force the task to use

specific algorithm.

  • nistp384: Host key algorithm to use when connecting to server.

Default value is Any which doesn't force the task to use

specific algorithm.

  • nistp521: Host key algorithm to use when connecting to server.

Default value is Any which doesn't force the task to use

specific algorithm.

Default: 0 Example: HostKeyAlgorithms.RSA

UseKeyboardInteractiveAuthentication : Boolean

Enable if the server uses keyboard-interactive authentication method.

Default: False Example: false

PromptAndResponse : PromptResponse[]

Responses for the server prompts when using Keyboard Interactive authentication method.

Default: - Example: -

BufferSize : UInt32

Integer value of used buffer size as KB.

Default value is 32 KB.

Default: 32 Example: 32

Task Result

Name
Description

Files : List<FileItem>

List of FileItem objects with source path and target path attributes. Example: [object { SourcePath: /source/test1.txt, TargetPath: /destination/test1.txt }, object { SourcePath: /source/test2.txt, TargetPath: /destination/test2.txt } ]

Message : String

Message consisting information on the transfer. Example: Successfully moved 2 files to /destination/.

Task Changelog

Changelog for Task Frends.SFTP.MoveFile.

[2.0.0] - 2026-01-27

Changed

Breaking changes!

  • Updated dependency SSH.NET to the newest version 2025.1.0.

  • Drop DSS support

[1.5.0] - 2026-01-16

Fixed

  • Task can now create nested target directories.

[1.4.0] - 2026-01-13

Fixed

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

[1.3.0] - 2025-01-10

Fixed

  • Fixed issue with ConnectionInfoBuilder having static properties for connection and input parameters which lead to Task not being thread safe.

[1.2.0] - 2024-08-19

Updated

  • Updated Renci.SshNet library to version 2024.1.0.

Added

  • Added more tests.

[1.1.0] - 2023-12-22

Updated

  • [Breaking] Updated dependency SSH.NET to the newest version 2023.0.0.

Changed

  • Changed connection info builder to create the connection info as it's done in DownloadFiles.

  • [Breaking] Changed PrivateKeyFilePassphrase parameter to PrivateKeyPassphrase and enabled it when PrivateKeyString was used.

Added

  • Added FileEncoding for file names.

[1.0.0] - 2023-22-05

Added

  • Initial implementation

Last updated

Was this helpful?