N/sftp SuiteScript Module for File Management

The N/sftp SuiteScript module enables folder management and file transfers from external SFTP servers using secure connections.

·2 min read·1 views·View Oracle Docs

The N/sftp module allows you to manage folders and perform file uploads or downloads from external SSH file transfer (SFTP) servers. It is crucial because it enables seamless data transfers between your NetSuite instance and external platforms, ensuring robust integration with your file management system.

How Does the N/sftp Module Work?

This module is designed specifically for server scripts, facilitating various SFTP operations, which include:

  • Establishing connections to remote SFTP servers.
  • Uploading and downloading files.
  • Managing directories on these servers.

Key Features of the N/sftp Module

  • Connection Management: The module provides an sftp.Connection object that represents a connection to a remote FTP server. You can establish this connection using the sftp.createConnection(options) method.
  • Timeouts: It holds enumerated values for minimum and maximum connection timeouts, as well as port numbers, ensuring that your connections are stable and secure.
  • File and Directory Operations: You can perform various operations such as downloading, uploading, creating and removing directories, and listing remote directories using provided methods on the sftp.Connection object.

Important Notes

When using the N/sftp module:

  • Wildcards in Paths: Ensure that wildcards like ? and * in paths and filenames are properly escaped unless you intend for them to function as wildcards.
  • Security: Utilize SSH keys for establishing connections. This approach is safer and is supported by methods in the N/keyControl module, allowing you to manage keys securely within NetSuite.

SFTP Connection Establishment

To establish an SFTP connection, you must utilize SSH keys. This is done via the Private Keys page accessible in NetSuite. Only users with the appropriate permissions can manage these keys. Once set, you can easily integrate SFTP functionality into your scripts.

Who This Affects

  • Administrators: Responsible for configuring SFTP settings and managing SSH keys.
  • Developers: Who will implement SFTP file transfers in their SuiteScript applications.

Key Takeaways

  • The N/sftp module is essential for managing file transfers via SFTP in NetSuite.
  • Utilizing secure SSH keys enhances the security of file transfer operations.
  • Proper management of paths and escape characters is crucial to avoiding errors during file operations.

Source: This article is based on Oracle's official NetSuite documentation.

Frequently Asked Questions (4)

Is the N/sftp SuiteScript module compatible with both client and server scripts?
The N/sftp SuiteScript module is specifically designed for server scripts to facilitate SFTP operations.
Are there specific permissions required to manage SSH keys for SFTP connections in NetSuite?
Yes, only users with appropriate permissions can manage SSH keys by accessing the Private Keys page in NetSuite.
How are wildcards in paths handled when using the N/sftp module?
Wildcards such as '?' and '*' must be properly escaped unless you intend for them to function as wildcards in paths and filenames.
What methods are available in the N/sftp module for managing remote directories?
The N/sftp module provides methods for downloading, uploading, creating and removing directories, and listing remote directories through the sftp.Connection object.
Source: N/sftp Module Members Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Integration

View all Integration articles →