Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
NetSuite Tip - Uploading a file to an FTP server N/sftp
var connection = sftp.createConnection({
username: userName,
passwordGuid: passGUID,
url: URL,
directory: '/',
hostKey: hostKey
});
//if you have a xml content or json content, create them as a file and upload to FTP
//Module: N/file :> file
var FileToUpload = file.create({
fileType: file.Type.PLAINTEXT,
name: XMLfileName,
contents: soData, //here soData refers to a xml body
});
connection.upload({
directory: '/Outbox/To be Processed', //directory of FTP to upload
file: FileToUpload,
filename: XMLfileName,
replaceExisting: true
});