File
A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format.
Extends
Extended by
Implements
Constructors
new File()
new File(fileParts
, name
, options
): File
Parameters
Parameter | Type |
---|---|
fileParts | BlobPart [] |
name | string |
options | FilePropertyBag |
Returns
Overrides
Properties
Property | Type | Description |
---|---|---|
lastModified | number | MDN Reference |
name | string | MDN Reference |
webkitRelativePath | string | MDN Reference |
Accessors
size
get
size(): number
Returns the size of the Blob object, in bytes.
Returns
number
Implementation of
globalThis.File.size
Inherited from
type
get
type(): string
Returns the MIME type of the Blob object.
Returns
string
Implementation of
globalThis.File.type
Inherited from
Methods
arrayBuffer()
arrayBuffer(): Promise
<ArrayBuffer
>
Returns a promise that resolves with an ArrayBuffer representing the Blob's data.
Returns
Implementation of
globalThis.File.arrayBuffer
Inherited from
slice()
slice(start
, end
, type
): Blob
Returns a new Blob object containing the data in the specified range of bytes of the source Blob.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
start | number | 0 | The start byte index. |
end | number | ... | The end byte index. |
type | string | '' | The content type of the new Blob. |
Returns
Implementation of
globalThis.File.slice
Inherited from
stream()
stream(): ReadableStream
<Uint8Array
>
Returns a stream that can be used to read the contents of the Blob.
Returns
Implementation of
globalThis.File.stream
Inherited from
text()
text(): Promise
<string
>
Returns a promise that resolves with a string representation of the Blob object.
Returns
Promise
<string
>
Implementation of
globalThis.File.text