Create and save a file to the file cabinet

require(['N/file'], file => {
let fileObj = file.create({
name: 'sample file',
fileType: file.Type.PLAINTEXT,
contents: 'HelloWorld'
});

// a valid folder ID from netsuite account
fileObj.folder = -15;

// Save the file
let fileId = fileObj.save();

Leave a comment

Your email address will not be published. Required fields are marked *