Skip to content

attach()

Attaches a file to a file input element.

await attach('c:/abc.txt', to('Please select a file:'))
await attach('c:/abc.txt', 'Please select a file:')
await attach('c:/abc.txt', 'Please select a file:',{force:true})
NameTypeDescription
filepathstring | Arrayor filepaths- The path or paths of the file to be attached.
toselector | stringThe file input element to which to attach the file.
optionsunknownDefault: {}.

This API does not return any values.