file-open
v0.1.1
Published
Opens a local file from the browser
Downloads
69
Readme
file-open
Opens a file from the browser.
Usage
import fileOpen from 'file-open';
const button = document.querySelector('#chooser-button');
button.addEventListener('click', async function() {
const files = await fileOpen();
console.log(files);
});
API
fileOpen(opts) => Promise<File[]>
opts.multiple
Allows selection of multiple filesopts.accept
Specifies allowed file extensions or MIME types. more
See also
- file-drops - simple browser file drop utility
License
MIT