Skip to content

Function: fileFromInput()

ts
function fileFromInput(
   ctx: Context, 
   selector: string, 
options?: WaitForSelectorOptions): Promise<SdkFile[]>;

Defined in: src/file/getFile.tsx:254

Parameters

ParameterTypeDescription
ctxContextContext object.
selectorstringSelector or XPath for File Input element.
options?WaitForSelectorOptions-

Returns

Promise<SdkFile[]>

The file as an Array of blobs for files contained in element.

Deprecated

Returns the files attached to a file input.

Example

ts
const attachments = await fileFromInput(ctx, '.attachment');
const pdfs = attachments.filter(f => f.type === 'application/pdf');
const invoices = pdfs.filter(f => f.name.startsWith('invoice-'));
// ...

Matterway Assistant SDK Documentation