Modules

filter

 

Objects/Functions

module (N/file)

SuiteScript 2.0

File.getContents()

{File}.getContents(){SSS_FILE_CONTENT_SIZE_EXCEEDED: {The file content you are attempting to access exceeds the maximum allowed size of 10 MB.}})

N/file Module
File.getContents()
Method Description: Method used to return the content of the file. Content held in memory is limited to 10MB. You can access CSV or text files (including files over 10MB) using File.appendLine(options) or File.lines.iterator().
Returns: The file content as a string
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.getContents()

Example:

// Code Example 1
//Add additional code
//...
var fileObj = file.load({
id: 145
});
if (fileObj.size < 10485760){
fileObj.getContents();
}
//...
//Add additional code

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