Setting up an SFTP Transfer
Development Preparation for SFTP transfers
Follow these steps to successfully connect to your SFTP server with SuiteScript:
-
Talk to your SFTP service provider about your plans.
-
Determine the connection properties required to connect with your external SFTP server. For example:
-
username
-
password/key
-
url
-
port
-
upload/download directories
-
host key
-
host key type
-
-
Make sure that you know your provider’s practices around host key changes, maintenance and failover. For example, find out if there are multiple URLs or ports to try.
-
Check compatibility with the SFTP ciphers supported by NetSuite. See Supported Cipher Suites and Host Key Types.
-
Determine if your provider requires at-rest file encryption (in addition to what the SFTP protocol provides during transfer). Decide if you need to add file encryption.
-
-
Build a credential management Suitelet to capture username and password token. Then, test the connection.
-
Create custom fields to store the user's SFTP username and password token
-
Implement the Suitelet.
-
Draw a form on a GET request.
-
Save the username and password token on a POST request.
-
Test the connection.
See Creating a Suitelet Form that Contains a Credential Field.
-
-
-
Build a server script to handle operations such as:
-
Load a File Cabinet file and upload it to the SFTP server.
-
Download an on demand file from the SFTP server and save it in File Cabinet.
-
Execution of an SFTP transfer
The following steps occur during a successful SFTP transfer using SuiteScript:
-
The user submits their SFTP credentials using a Suitelet.
-
The Suitelet captures and stores the credential token.
-
A server script is triggered.
-
The script identifies the appropriate credential token and other connection attributes, and establishes the SFTP connection.
-
The script requests the transfer.