web-file-explorer
v0.1.1
Published
Browser file explorer boost.
Readme
Library for using web input file explorer.
It creates hidden <input type="file" /> element. Useful for custom uploading buttons, etc.
Install:
npm i -S web-file-exploreryarn add web-file-explorer
Usage
Open file explorer and get file:
import fileExplorer from 'web-file-explorer'
const file = await fileExplorer.getFile()
const imageFile = await fileExplorer.getFile({ acceptImage: true })API
accept(optional)string | string[]- list of allowed mime typesacceptImage(optional)boolean- allow image files. Popular formats only by default.acceptVideo(optional)boolean- allow video files. Popular formats only by default.acceptAudio(optional)boolean- allow audio files. Popular formats only by default.
If there no filters applied. Accept field will be '*'
