Skip to content
providerkit
GitHub

AttachmentFile

Defined in: react/src/attachments.ts:17

What the composer reads from a file the person picked, before it is uploaded. A web File already fits. A phone picker returns no File: pass its own object with these fields added, like React Native’s { uri, name, type }. The composer keeps that object and hands the same one to upload, so the uploader can still read the rest, such as a uri or a native handle.

name: string;

Defined in: react/src/attachments.ts:18


optional size?: number;

Defined in: react/src/attachments.ts:24

Bytes, when the picker knows them. Some pickers do not, and then maxFileBytes is the host’s to enforce: a guessed size would refuse a file the host accepts, or pass one it refuses.


type: string;

Defined in: react/src/attachments.ts:20

The media type, like image/png.