File

Implements the File class from the Node.js buffer built-in module. This type is basically a specialized Blob with additional name and lastModified fields.

Inheritors

Properties

Link copied to clipboard
abstract val lastModified: Long

An epoch timestamp indicating the last modification to this file.

Link copied to clipboard
abstract val name: String

The name of the file.

Link copied to clipboard
abstract val size: Int

Size in bytes of this blob.

Link copied to clipboard
abstract val type: String?

The content type of this Blob. Note that this value is informative only.

Functions

Link copied to clipboard

Returns a promise which resolves with a JavaScript ArrayBuffer object containing a copy of this blob's data.

Link copied to clipboard
abstract fun slice(start: Int? = null, end: Int? = null, type: String? = null): BufferAPI.Blob

Returns a copy of this blob between the requested indices, and optionally with a different type.

Link copied to clipboard
abstract fun stream(): ReadableStream

Returns a stream that can be used to read the contents of this blob.

Link copied to clipboard
abstract fun text(): JsPromise<String>

Returns a promise which resolves with the result of decoding this blob's data as a UTF-8 string.