Suitelet Script sample that renders an HTML file from the NetSuite File Cabinet:


let fileId = 'fileInternalId';
let fileObj = file.load({ id: fileId });
let fileContent = fileObj.getContents();
scriptContext.response.headers['Content-Type'] = 'text/html';
scriptContext.response.write(fileContent);

Leave a comment

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