0.1.1 • Published 3 years ago

web-file-explorer v0.1.1

Weekly downloads
92
License
MIT
Repository
github
Last release
3 years ago

Library for using web input file explorer.

It creates hidden <input type="file" /> element. Useful for custom uploading buttons, etc.

npm

Install:

  • npm i -S web-file-explorer
  • yarn 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 types
  • acceptImage (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 '*'

0.1.1

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.1-rc.2

3 years ago

0.0.1-rc.1

3 years ago