Appearance
Function: mwFileToInput()
ts
function mwFileToInput(
ctx: Context,
file: MwFile,
selector: string): Promise<void>;Defined in: src/file/offerMwFile.tsx:168
Experimental
Attach an MwFile to a file input element on the page.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | Context object. |
file | MwFile | The MwFile to attach. |
selector | string | CSS selector for the file input element. |
Returns
Promise<void>
Resolves when the file is attached.
Example
ts
const resume = await mwFileFromDrive('/Documents/resume-2026.pdf', 'application/pdf');
await mwFileToInput(ctx, resume, '#job-application input[type="file"]');
console.log('Attached', resume.name, 'to the job application form');