open-file-dialog
v1.0.1
Published
Opens the browsers file dialog
Downloads
188
Readme
open-file-dialog
Opens the browsers file dialog
Usage
var dialog = require('./')
var btn = document.createElement('button')
btn.innerText = 'Upload images'
btn.addEventListener('click', function () {
dialog({
multiple: true,
accept: 'image/*'
}, function (images) {
console.log(images)
})
})
document.body.appendChild(btn)
API
dialog(opts, cb)
opts.multiple
Allows selection of multiple filesopts.accept
Specifies allowed file extensions or MIME types. more