Attaches a file to an input element on a web page, using the Matterway SDK context to execute the attachment process within the page.
The Matterway SDK context.
The SdkFile object containing the file data and metadata to be attached.
The selector for the input element on the page.
Promise of void
const file = { name: 'example.txt', data: 'SGVsbG8gV29ybGQh', type: 'text/plain' };const selector = 'input[type="file"]';await fileToInput(context, file, selector); Copy
const file = { name: 'example.txt', data: 'SGVsbG8gV29ybGQh', type: 'text/plain' };const selector = 'input[type="file"]';await fileToInput(context, file, selector);
Generated using TypeDoc
Attaches a file to an input element on a web page, using the Matterway SDK context to execute the attachment process within the page.