Skip to content

File

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1079

The File interface provides information about files and allows JavaScript in a web page to access their content.

MDN Reference

new File(bits, name, options?): File

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1080

undefined | (string | ArrayBuffer | Blob | ArrayBufferView<ArrayBufferLike>)[]

string

FileOptions

File

Blob.constructor

readonly lastModified: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1096

The lastModified read-only property of the File interface provides the last modified date of the file as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).

MDN Reference


readonly name: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1090

The name read-only property of the File interface returns the name of the file represented by a File object.

MDN Reference


readonly size: number

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1033

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

MDN Reference

Blob.size


readonly type: string

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1039

The type read-only property of the Blob interface returns the MIME type of the file.

MDN Reference

Blob.type

arrayBuffer(): Promise<ArrayBuffer>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1051

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

Promise<ArrayBuffer>

Blob.arrayBuffer


bytes(): Promise<Uint8Array<ArrayBufferLike>>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1057

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

Promise<Uint8Array<ArrayBufferLike>>

Blob.bytes


slice(start?, end?, type?): Blob

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1045

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

number

number

string

Blob

Blob.slice


stream(): ReadableStream

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1069

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

MDN Reference

ReadableStream

Blob.stream


text(): Promise<string>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1063

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

MDN Reference

Promise<string>

Blob.text