Naughty Platypus Memorabilia

    web-file-explorer
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.1 • Public • Published

    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 '*'

    Install

    npm i web-file-explorer

    DownloadsWeekly Downloads

    0

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    5.39 kB

    Total Files

    4

    Last publish

    Collaborators

    • zvs001