# j-FileUpload

> Is very helpful component for uploading e.g. profile photos. I consider this component as inline file upload. Look into the html source. The component uploads files via multipart/form-data.

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

Is very helpful component for uploading e.g. profile photos. I consider this component as inline file upload. Look into the html source. The component uploads files via `multipart/form-data`.

__Configuration__:

- `url` {String} a target URL for the uploading
- `accept` {String} (optional) can contain a content-type frow browsing files e.g. `image/*`
- `multiple` enables `multiple` files upload (default: `false`)
- `array` {Boolean} enables pushing an uploaded value to array (`path` must be the array)
- `label` {String} (optional) changes a current `innerHTML` (default: `innerHTML`)
- `disabled` {Boolean} disables

__Friendly components__:
This component works with `loading` (when the file is uploading) and `message` (when server throws an error) component.

Use it with `<ui-component name="fileupload">`. 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
<a href="javascript:void(0)"><ui-component name="fileupload" path="mypicture" config="url:/my-upload-url/">Upload</ui-component></a>

<script>
	var mypicture = '';
</script>
```
