Function getDataFromFileInput

  • Returns the files attached to a file input.

    Parameters

    • ctx: Context

      Context object.

    • selector: string

      Selector for File Input element.

    • Optional options: WaitForSelectorOptions

    Returns Promise<File[]>

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

    Example

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

Generated using TypeDoc