Class: FileSelector

html.FileSelector

Class representing a file selector trigger.

new html.FileSelector ()

Properties:
Name Type Description
accept Array.<string>

(default: ["*"]) A list of accepted MIME type patterns.

directory bool

(default: false) Whether to select directories instead of files.

multiple bool

(default: false) Whether to allow multi-selection.

Example
Button {
    text: "Select Files"

    onClick: () =>
    {
        fsel.open(files =>
        {
            console.log(files);
        });
    }

    FileSelector {
        id: fsel
        accept: ["audio/*", "video/*"]
        multiple: true
    }
}

Extends

Methods

open (callback)

Opens the file dialog.

Name Type Default Description
callback function null optional

An optional callback function accepting the selected HTML5 File items.

Events

html.FileSelector.event:select

Is triggered when the user selected files or directories.

Name Type Description
files Array.<File>

The selected HTML5 file objects.