file-open
Version:
Opens a local file from the browser
35 lines (19 loc) • 666 B
Markdown
file from the browser.
```js
import fileOpen from 'file-open';
const button = document.querySelector('#chooser-button');
button.addEventListener('click', async function() {
const files = await fileOpen();
console.log(files);
});
```
- `opts.multiple` Allows selection of multiple files
- `opts.accept` Specifies allowed file extensions or MIME types. [more](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Limiting_accepted_file_types)
* [file-drops](https://github.com/nikku/file-drops) - simple browser file drop utility
MIT
Opens a