Modules

filter

 

Objects/Functions

module (N/file)

SuiteScript 2.0

file.create(options)

{file}.create({name: {string*},fileType: {enum*},contents: {string},description: {string},folder: {number},encoding: ${7:string},isInactive: ${8:boolean},isOnline: ${9:boolean}})

N/file Module
file.create()
Method Description: Method used to create a new file in the NetSuite File Cabinet. Content held in memory is limited to 10MB.
Returns: file.File
Supported Script Types: Server-side scripts For more information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/file Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=file.create(options)

Example:

// Code Example 1
//Add additional code
//...
var fileObj = file.create({
name: 'test.txt',
fileType: file.Type.PLAINTEXT,
contents: 'Hello World\nHello World',
description: 'This is a plain text file.',
encoding: file.Encoding.UTF8,
folder: 30,
isOnline: true
});
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4223861820.html