aem-forms-af-runtime

Class: FileObject

Defines a file object which implements the file object interface

Implements

Table of contents

Constructors

Properties

Methods

Accessors

Constructors

constructor

• new FileObject(init?)

Parameters

Name Type
init? Partial<FileObject>

Properties

data

• data: any

Data of the file attachment. It can be uri or any file interface specific to channel (in web, it is file object).

Implementation of

IFileObject.data


mediaType

• mediaType: string = 'application/octet-stream'

Media type of the file data

Implementation of

IFileObject.mediaType


name

• name: string = 'unknown'

Name of the file

Implementation of

IFileObject.name


size

• size: number = 0

Size of the file binary as per iec specification.

Implementation of

IFileObject.size

Methods

equals

▸ equals(obj): boolean

Parameters

Name Type
obj IFileObject

Returns

boolean


toJSON

▸ toJSON(): Object

Returns

Object

Name Type
data any
mediaType string
name string
size number

Accessors

type

• get type(): string

Returns

string

• set type(type): void

Parameters

Name Type
type string

Returns

void