# j-FileBrowser

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

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 8669e92a3c5d0bd8069ed75378492a6c3111e62f6e69162f9060a3776075daac
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

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.

```html 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>
```
