Procedures

Automation procedures in the SFTP BDK Book.

to copy an item to a folder

Copy an item to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to copy

sftp file reference or sftp folder reference

Yes

The folder to copy the item to

sftp folder reference

Yes

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

fail

Examples

Copy a file on the SFTP server

copy the new file to the copydestination
    the conflict behavior is "replace"

to create a (folder) in another folder

Create a (folder) in another folder

Input Concepts

Concept
Description
Type
Required
Default Value

The folder to create the (folder) in

sftp folder reference

Yes

folder name

The name of the (folder) to create

text

Yes

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

fail

Output Concepts

Concept
Description
Type

a folder reference to the created folder

sftp folder reference

Examples

Create a directory on the SFTP server

get a folder at "/dir1/dir2"
create a folder in the folder
    the folder name is "a-folder"
    the conflict behavior is "rename"

to delete an item

Delete an item (file or folder)

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to delete

sftp file reference or sftp folder reference

Yes

Examples

Delete a file from the SFTP server

get a folder at "/dir1/dir2"
get the folder's items whose name is "one.txt"
use the first item as the document
delete the document

to download a file

Download a file

Input Concepts

Concept
Description
Type
Required
Default Value

The file reference to the file to download

sftp file reference

Yes

Output Concepts

Concept
Description
Type

answer

the file as an IO object

file

Examples

Download a file from the SFTP server

get the folder's items
use the first item as the testing file
    download the testing file

to get a (folder) at a path

Gets a reference to a folder.

Input Concepts

Concept
Description
Type
Required
Default Value

path

The path to the folder

text

Yes

Output Concepts

Concept
Description
Type

a folder reference

sftp folder reference

Examples

Get a folder at a path.

get a folder at "/dir1/dir2"

to get a (root folder)

Gets a reference to the root folder.

Output Concepts

Concept
Description
Type

a folder reference

sftp folder reference

Examples

Get the root folder

get a root folder

to get some (folder's items)

FILTER - CAPABLE

Lists items from a folder reference

Input Concepts

Concept
Description
Type
Required
Default Value

The folder reference from which to list the items

sftp folder reference

Yes

Output Concepts

Concept
Description
Type

folder's items

a list of Items (file or folder) containing the items in the folder

sftp file reference or sftp folder reference

Examples

List files in a directory on the SFTP server

get a folder at "/dir1/dir2"
get the folder's items

List files in a directory on the SFTP server with a filter expression

get a folder at "/dir1/dir2"
get the folder's items whose name is not "one.txt"

to move an item to a folder

Move an item to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to move

sftp file reference or sftp folder reference

Yes

The folder to move the item to

sftp folder reference

Yes

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

fail

Examples

Move a file on the SFTP server

move the new file to the movedestination
    the conflict behavior is "replace"

to rename an item to a name

Rename an item (file or folder) to a given name

Input Concepts

Concept
Description
Type
Required
Default Value

item

The item (file or folder) to rename

sftp file reference or sftp folder reference

Yes

name

The new name of the item

text

Yes

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

fail

Examples

Rename a file on the SFTP server

get a folder at "/dir1/dir2"
get the folder's items whose name is "one.txt"
use the first item as the new document
rename the new document to "the-renamed-file.txt"
    the conflict behavior is "rename"

to upload a (file) to a folder

Upload a file to a folder

Input Concepts

Concept
Description
Type
Required
Default Value

file

The file to upload

file

Yes

The folder to upload the file to

sftp folder reference

Yes

file name

The name of the file to upload

text

Yes

conflict behavior

The behavior to use on conflict scenarios. It should be one of the following values: ('fail', 'replace', 'rename')

text

No

fail

Output Concepts

Concept
Description
Type

a file reference to the uploaded file

sftp file reference

Examples

Upload a file to the SFTP server

the document
upload the document to the folder
    the file name is "juan.txt"
    the conflict behavior is "rename"

Last updated

Was this helpful?