Skip to main content

sdk.file_2.sdkfile

Home > @matterway/sdk > File_2 > SdkFile

File_2.SdkFile class

Represents a file that has been loaded into memory from a base64-encoded data string.

Signature:

export declare class SdkFile 

Constructors

ConstructorModifiersDescription
(constructor)(data, name, type)Constructs a new instance of the SdkFile class

Properties

PropertyModifiersTypeDescription
datastringThe base64-encoded data for the file.
lastModifiednumberLast modified time, in ms from epoch.
namestringName of the file.
sizenumberSize in bytes.
typestringMIME type.
webkitRelativePathstringRelative path to the file.

Methods

MethodModifiersDescription
arrayBuffer()Reads the data stream to completion, and returns it as ArrayBuffer.
slice(start, end, type)Returns a new File with only data in the given range of bytes.
text()Reads the data stream to completion, and returns it as string.