Appearance
Function: fileFromInput()
ts
function fileFromInput(
ctx: Context,
selector: string,
options?: WaitForSelectorOptions): Promise<SdkFile[]>;Defined in: src/file/getFile.tsx:254
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
selector | string | Selector 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-'));
// ...