FilesFor3PStorage interface

Note

This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Object used to represent a file

Extends

Blob

Properties

lastModified

A number that represents the number of milliseconds since the Unix epoch

name

Name of the file

type

file type

webkitRelativePath

A string containing the path of the file relative to the ancestor directory the user selected

Inherited Properties

size

The size read-only property of the Blob interface returns the size of the Blob or File in bytes.

MDN Reference

Inherited Methods

arrayBuffer()

The arrayBuffer() method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer.

MDN Reference

bytes()

The bytes() method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.

MDN Reference

slice(number, number, string)

The slice() method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it's called.

MDN Reference

stream()

The stream() method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.

MDN Reference

text()

The text() method of the string containing the contents of the blob, interpreted as UTF-8.

MDN Reference

Property Details

lastModified

A number that represents the number of milliseconds since the Unix epoch

lastModified: number

Property Value

number

name

Name of the file

name: string

Property Value

string

type

file type

type: string

Property Value

string

webkitRelativePath

A string containing the path of the file relative to the ancestor directory the user selected

webkitRelativePath?: string

Property Value

string

Inherited Property Details

size

The size read-only property of the Blob interface returns the size of the Blob or File in bytes.

MDN Reference

size: number

Property Value

number

Inherited From Blob.size

Inherited Method Details

arrayBuffer()

The arrayBuffer() method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer.

MDN Reference

function arrayBuffer(): Promise<ArrayBuffer>

Returns

Promise<ArrayBuffer>

Inherited From Blob.arrayBuffer

bytes()

The bytes() method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.

MDN Reference

function bytes(): Promise<Uint8Array<ArrayBuffer>>

Returns

Promise<Uint8Array<ArrayBuffer>>

Inherited From Blob.bytes

slice(number, number, string)

The slice() method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it's called.

MDN Reference

function slice(start?: number, end?: number, contentType?: string): Blob

Parameters

start

number

end

number

contentType

string

Returns

Blob

Inherited From Blob.slice

stream()

The stream() method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.

MDN Reference

function stream(): ReadableStream<Uint8Array<ArrayBuffer>>

Returns

ReadableStream<Uint8Array<ArrayBuffer>>

Inherited From Blob.stream

text()

The text() method of the string containing the contents of the blob, interpreted as UTF-8.

MDN Reference

function text(): Promise<string>

Returns

Promise<string>

Inherited From Blob.text