file.Type

Enum Description

Enumeration that holds the string values for supported file types. This enum is used to set the value of the File.fileType property.

Note that the File.fileType property is read-only. It’s value must be set with file.create(options).

See N/file Module Script Samples for an example.

Note:

JavaScript does not include an enumeration type. The SuiteScript 2.0 documentation utilizes the term enumeration (or enum) to describe the following: a plain JavaScript object with a flat, map-like structure. Within this object, each key points to a read-only string value.

Module

N/file Module

Sibling Module Members

N/file Module Members

Since

2015.2

Values

Value

APPCACHE

AUTOCAD

BMPIMAGE

CERTIFICATE

CONFIG

CSV

EXCEL

FLASH

FREEMARKER

GIFIMAGE

GZIP

HTMLDOC

ICON

JAVASCRIPT

JPGIMAGE

JSON

MESSAGERFC

MP3

MPEGMOVIE

MSPROJECT

PDF

PJPGIMAGE

PLAINTEXT

PNGIMAGE

POSTSCRIPT

POWERPOINT

QUICKTIME

RTF

SCSS

SMS

STYLESHEET

SVG

TAR

TIFFIMAGE

VISIO

WEBAPPPAGE

WEBAPPSCRIPT

WORD

XMLDOC

XSD

ZIP

Syntax
Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/file Module Script Samples.

          //Add additional code 
...
var fileObj = file.create({
    name    : 'test.txt',
    fileType: file.Type.PLAINTEXT,
    contents: 'Hello World\nHello World'
});
fileObj.folder = 30;
var fileId = fileObj.save();
...
 //Add additional code 

        

Related Topics

General Notices