Skip to content

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

ParameterTypeDescription
ctxContextContext object.
fileMwFileThe MwFile to attach.
selectorstringCSS 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');

Matterway Assistant SDK Documentation