Connection Object Members Management in SuiteScript
The Connection Object Members in SuiteScript facilitate file management on SFTP servers via methods for uploading, downloading, and directory management.
The Connection Object Members in SuiteScript enable developers to efficiently manage file transfers and directories on SFTP servers. Using the N/sftp module, these methods cover various functionalities like uploading, downloading, and organizing files in a remote directory.
What Are Connection Object Members?
The Connection Object Members are methods and enumerations you can call on the sftp.Connection object within the N/sftp module. These members allow you to interact with an SFTP server programmatically, providing a streamlined approach to file management.
Key Functionalities of Connection Object Members
The following methods are available on the sftp.Connection object:
| Member Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Method | Connection.download(options) | file.File | Server scripts | Downloads a file from the remote FTP server. |
| Method | Connection.upload(options) | void | Server scripts | Uploads a file to the remote FTP server. |
| Method | Connection.makeDirectory(options) | string | Server scripts | Creates an empty directory. |
| Method | Connection.removeDirectory(options) | void | Server scripts | Removes an empty directory. |
| Method | Connection.removeFile(options) | void | Server scripts | Removes a file in a directory. |
| Method | Connection.move(options) | void | Server scripts | Moves a file or directory from one location to another. |
| Method | Connection.list(options) | Array<Object> | Server scripts | Lists items in the remote directory. |
| Enum | Connection.MAX_FILE_SIZE | enum | Server scripts | Holds the values for the maximum file size. |
| Enum | Connection.MAX_TRANSFER_TIMEOUT | enum | Server scripts | Holds the values for the maximum transfer timeout. |
Important Notes on Using Connection Object Members
- Escaping Wildcards: All paths, directories, and filenames with wildcards like
?and*must have those characters escaped unless they are specifically intended to function as wildcards. This is crucial for ensuring accurate file operation commands. - SSH Key Requirements: Establish an SFTP connection using SSH keys. These keys must be uploaded through NetSuite's secure interface, capturing necessary permissions. For key management tasks, refer to the N/keyControl module for effective handling.
Related Functionalities
While the Connection Object Members focus on file management, other aspects of SFTP in NetSuite can be achieved using:
- RESTlets: For data transfer without SFTP, RESTlets can manage file uploads and downloads.
- SOAP Web Services: These allow CRUD operations on file records, facilitating direct interaction with the File Cabinet.
Conclusion
The Connection Object Members in SuiteScript provide a structured method for managing SFTP file operations with methods for uploading, downloading, and directory management, making file interactions programmatically efficient.
Source: This article is based on Oracle's official NetSuite documentation.
Key Takeaways
- Connection Object Members simplify SFTP operations such as upload/download.
- Escaping wildcards is necessary for file path accuracy.
- SSH keys are required for secure SFTP connections and must be managed through NetSuite.
- RESTlets and SOAP Web Services offer alternatives for file operations without SFTP.
Frequently Asked Questions (4)
Which script types support the methods on the sftp.Connection object?
Do I need to upload SSH keys separately when using Connection Object Members?
How should I handle wildcards in file paths when using Connection Object Members?
Can Connection Object Members be used for file operations other than SFTP in NetSuite?
Was this article helpful?
More in Integration
- Natural Language Queries in NetSuite AI
MCP Standard Tools SuiteApp enables AI-driven data tasks in NetSuite, aligned with role permissions.
- Square Connector Integration in NetSuite 2026.1
Discover the Square Connector for seamless integration with NetSuite 2026.1, synchronizing transactions, orders, and inventory effortlessly.
- SuiteTalk Web Services Updates for NetSuite Integrations
SuiteTalk Web Services adds new Item Supply Plan support, enhancing integrations for efficient data management.
- SuiteTalk Web Services Enhancements in NetSuite
Explore the latest enhancements to SuiteTalk Web Services, improving integration and API functionalities in NetSuite.
Advertising
Reach Integration Professionals
Put your product in front of NetSuite experts who work with Integration every day.
Sponsor This Category