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.
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”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
Parameters
Section titled “Parameters”undefined | (string | ArrayBuffer | Blob | ArrayBufferView<ArrayBufferLike>)[]
string
options?
Section titled “options?”Returns
Section titled “Returns”File
Overrides
Section titled “Overrides”Properties
Section titled “Properties”lastModified
Section titled “lastModified”
readonlylastModified: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).
readonlyname: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.
readonlysize: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.
Inherited from
Section titled “Inherited from”
readonlytype: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.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”arrayBuffer()
Section titled “arrayBuffer()”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.
Returns
Section titled “Returns”Promise<ArrayBuffer>
Inherited from
Section titled “Inherited from”bytes()
Section titled “bytes()”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.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
Inherited from
Section titled “Inherited from”slice()
Section titled “slice()”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.
Parameters
Section titled “Parameters”start?
Section titled “start?”number
number
string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”stream()
Section titled “stream()”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.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”text()
Section titled “text()”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.
Returns
Section titled “Returns”Promise<string>