file-dialog
Directly call the file browser dialog from your code, and get back the resulting array of
FileList
. Handy for when you need to post files via AJAX/Fetch. No more hacky hiding of
<input type="file">
elements. Support for Callbacks & Promises!
Install
For Webpack/Browserify projects...
npm install file-dialog --save
const fileDialog = require('file-dialog')
or with ES6 modules
import fileDialog from 'file-dialog'
<script>
includes
Classic
<script>
fileDialog
Examples
Get a File via a promise and POST to server via Fetch
Allow user to select only an image file
Allow user to select only images or videos
Allow user to select multiple image files at once
Classic callback version of the above