ForgeComponents
en

Components

j-FileBrowser

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20

The component will open a file browser and returns selected files.


Methods:

  • component.open(opt) - opens file browser
    • opt.multiple {Boolean} enables multiple files (default: false)
    • opt.accept {String} allows only specified content-type (default: undefined)
    • opt.callback {Function(files, e)} a callback

Use it with <ui-component name="filebrowser">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

example.html
<ui-component name="filebrowser"></ui-component>
<a href="javascript:fopen()">OPEN FILE</a>

<script>
	function fopen() {
		var opt = {};
		opt.multiple = true;
		// opt.accept = 'image/*';
		opt.callback = function(files, e) {
			console.log(files, e);
		};
		SETTER('filebrowser/show', opt);
	}
</script>