Creates a new File instance.
An Array strings, or ArrayBuffer, ArrayBufferView, Blob objects, or a mix of any of such objects, that will be put inside the File.
The name of the file.
Optionaloptions: FilePropertyBagAn options object containing optional attributes for the file.
Readonly[toReadonlylastThe last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight). Files without a known last modified date return the current date.
ReadonlynameName of the file referenced by the File object.
ReadonlysizeThe total size of the Blob in bytes.
ReadonlytypeThe content-type of the Blob.
Returns a promise that fulfills with an ArrayBuffer containing a copy of
the Blob data.
The blob.bytes() method returns the byte of the Blob object as a Promise<Uint8Array>.
const blob = new Blob(['hello']);
blob.bytes().then((bytes) => {
console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]
});
Creates and returns a new Blob containing a subset of this Blob objects
data. The original Blob is not altered.
Optionalstart: numberThe starting index.
Optionalend: numberThe ending index.
Optionaltype: stringThe content-type for the new Blob
Returns a new ReadableStream that allows the content of the Blob to be read.
Returns a promise that fulfills with the contents of the Blob decoded as a
UTF-8 string.
A
Blobencapsulates immutable, raw data that can be safely shared across multiple worker threads.Since
v15.7.0, v14.18.0