Skip to content

SFTP Service

Before you begin

In order to use the features in this section you need to have an active Spojit account. If you don't have an account you can checkout out the pricing and register here. If you already have an account you can login here.


This service can facilitate the transfer of computer files between a client and server via the Secure File Transfer Protocol (SFTP).


Authorization

The following authorization configuration needs to filled out in order to connect to the SFTP server:

Option Description Default Required
Host The address of the FTP server (i.e. ftp.dlptest.com). - TRUE
Port The port of the SFTP server. 22 TRUE
Username The username to log in to the SFTP server. - TRUE
Password The password to log in to the SFTP server. - TRUE

The following example configuration shows you how to configure the test SFTP server at Test.Rebex.Net (this server only allows files to be downloaded).

SFTP Authorization Configuration

Important

The host address does not require the protocol as it will default to SFTP.


Creating a file

Creating (or writing) a file will send the raw data output from another service(s) to a location.

Option Description Default Required
Method Select "write" to transfer a file. - TRUE
Path The location to write the file to (including the filename). - TRUE
Raw Data The raw data of the file that will be sent. - TRUE

Important

The path will always require the filename at the end of it (i.e '/path/to/file.txt').

Example configuration and mapping

The following example shows you how to configure a file system service to transfer a file to a location.

Write Configuration

This service doesn't require any service data setup.

This service will not provide any output data.


Updating a file

Updating a file will send the raw data output from another service(s) to a location if it exists.

Option Description Default Required
Method Select "update" to update a file. - TRUE
Path The location to update the file to (including the filename). - TRUE
Raw Data The raw data of the file that will be sent. - TRUE

Tip

This option will only update the file it if already exists on the server. If there is a possibility that the file will not exist use the Upsert (PUT) option instead.

Important

The path will always require the filename at the end of it (i.e '/path/to/file.txt').

Example configuration and mapping

The following example shows you how to configure a file system service to update a file.

Update Configuration

This service doesn't require any service data setup.

This service will not provide any output data.


Upserting a file

Upserting (or putting) a file will send the raw data output from another service(s) to a location. If it exists it will be overwritten and if it does not exist it will be created.

Option Description Default Required
Method Select "put" to upsert a file. - TRUE
Path The location to upsert the file to (including the filename). - TRUE
Raw Data The raw data of the file that will be sent. - TRUE

Tip

This option will create a file if it does not exist and update it if it already exists.

Important

The path will always require the filename at the end of it (i.e '/path/to/file.txt').

Example configuration and mapping

The following example shows you how to configure a file system service to upsert a file.

PUT Configuration

This service doesn't require any service data setup.

This service will not provide any output data.


Downloading a file

Downloading (or reading) a file will transer the raw data from the location to be used as output for other service(s).

Option Description Default Required
Method Select "read" to download a file. - TRUE
Path The location of the file to download (including the filename). - TRUE

Important

The path will always require the filename at the end of it (i.e '/path/to/file.txt').

Example configuration and mapping

The following example shows you how to configure a file system service to read a file.

Read Configuration

This service doesn't require any service data setup.

This service will produce the following raw data if the file transfered successfully:

{
  "data": "ID,Job\n1,Scuba Diver\n2,Plumber\n",
  "metadata": {}
}

Deleting a file

Deleting a file will remove a file from a location if it exists.

Option Description Default Required
Method Select "delete" to remove a file. - TRUE
Path The location of the file to delete (including the filename). - TRUE

Important

The path will always require the filename at the end of it (i.e '/path/to/file.txt').

Example configuration and mapping

The following example shows you how to configure a file system service to delete a file.

Delete Configuration

This service doesn't require any service data setup.

This service will not provide any output data.


Check if a file or directory exists

This option will check to see if a file exists at a given location.

Option Description Default Required
Method Select "has" to check if it exists. - TRUE
Path The location to check if it exists. - TRUE

Tip

This method can check if directories exist as well.

Example configuration and mapping

The following example shows you how to configure a file system service to delete a file.

Has Configuration

This service doesn't require any service data setup.

This service will produce the following boolean data (true if it exists, false if it does not exist):

{
  "data": true,
  "metadata": {}
}

Get list of files and directories

This option will get a list of files and folders in a specified directory.

Option Description Default Required
Method Select "list" to get a list of files. - TRUE
Path The location to get the list from. - TRUE
Recursive Whether is it recursive or not. FALSE FALSE
Example configuration and mapping

The following example shows you how to configure a file system service to retrieve a list of files and directories:

List Configuration

This service doesn't require any service data setup.

This service will produce the following array of files and directories:

{
    "data": [
    {
        "type": "file",
        "path": "357a3948-e3ad-4cb5-856b-1cde09c37b55.txt",
        "visibility": "public",
        "size": 16,
        "dirname": "",
        "basename": "357a3948-e3ad-4cb5-856b-1cde09c37b55.txt",
        "extension": "txt",
        "filename": "357a3948-e3ad-4cb5-856b-1cde09c37b55"
    },
    {
        "type": "file",
        "path": "59430d5e-ce73-4691-9fd7-705ab97cd792.txt",
        "visibility": "public",
        "size": 16,
        "dirname": "",
        "basename": "59430d5e-ce73-4691-9fd7-705ab97cd792.txt",
        "extension": "txt",
        "filename": "59430d5e-ce73-4691-9fd7-705ab97cd792"
    },
    {
        "type": "file",
        "path": "dea44f29-c9e3-441b-b02c-0d923112698d.txt",
        "visibility": "public",
        "size": 16,
        "dirname": "",
        "basename": "dea44f29-c9e3-441b-b02c-0d923112698d.txt",
        "extension": "txt",
        "filename": "dea44f29-c9e3-441b-b02c-0d923112698d"
    },
    {
        "type": "dir",
        "path": "Testing",
        "dirname": "",
        "basename": "Testing",
        "filename": "Testing"
    }
    ],
    "metadata": []
}

Creating a directory

Create a directory will create a directory in a location if it doesn't exist.

Option Description Default Required
Method Select "createDir" to create a directory. - TRUE
Path The location of the directory to create. - TRUE
Example configuration and mapping

The following example shows you how to configure a file system service to create a directory.

Create Directory Configuration

This service doesn't require any service data setup.

This service will not provide any output data.


Deleting a directory

Deleting a directory will remove a directory from a location if it exists.

Option Description Default Required
Method Select "deleteDir" to remove a directory. - TRUE
Path The location of the directory to delete. - TRUE
Example configuration and mapping

The following example shows you how to configure a file system service to delete a directory.

Delete Directory Configuration

This service doesn't require any service data setup.

This service will not provide any output data.

Back to top