Skip to main content
Skip table of contents

File

A File is a binary data value containing data of a document, an image or some other kind of file. Alongside the binary data is metadata, such as file name, that can be accessed if needed. 

Methods

getContentType()

Resolves into a String telling File's MIME type. If the MIME type cannot be defined, a generic "application/octet-stream" type is the result.  

For example, if 'logo' was an image file, the expression ${logo.getContentType()} might resolve into "image/png".

Using the shorthand form the expression becomes ${logo.contentType}.

getFileName()

Resolves into a String of the file name of the File. This should include the suffix appropriate to the File's type. In some cases the file name might be undefined, in which case the result is an empty String.

For example, if "composedDoc" is the File produced by a composeContent tag, the expression ${composedDoc.getFileName()} might resolve "Test template.html" if the document's title was "Test template".

Using the shorthand form the expression becomes ${composedDoc.fileName}.

getSize()

Resolves into a Number that is the amount of bytes the file's data consists of.

For example, the expression ${composedDoc.getSize()} resolves into a Number that is the byte size of the "composedDoc" variable's value.

Using the shorthand form the expression becomes ${composedDoc.size}.  

getTitle()

Resolves into a String of the title of the File. If the file's title is undefined, the result is an empty String.

For example, with 'sfFile' being a File produced by the SFDC "load" tag, the expression ${sfFile.getTitle()} would resolve into the value of the Title field of the record whose file data the tag loaded.

Using the shorthand form the expression becomes ${sfFile.title}.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.