# j-SingleUpload

> This component works with loading (when the file is uploading) and message (when server throws an error) component.

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

__Configuration__:

- `url` {String} a target URL for the uploading (default: `/api/upload/`)
- `accept` {String} (optional) can contain a content-type frow browsing files e.g. `image/*`
- `label` {String} (optional) changes a current `innerHTML` (default: `innerHTML`)
- `title` {String} Tangular template for rendering a title of attachment (default: `{{ name }}`)
- `disabled` {Boolean} disables the component
- `remap` {String} (optional) a remap function (default: `null`), example: `value.length ? value[0] : null`

__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="singleupload">`. 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="singleupload" path="mypicture"><i class="ti ti-folder"></i>Add attachment</ui-component>

<script>
	var mypicture = { name: 'my photo.jpg', url: '/download/3493874938438.jpg' };
</script>
```
