# FileUploader
The FileUploader component is a renderless component used to upload files. It
only works with a Jingrow Framework backend.
## Usage
Use the default slot to render any HTML you like. A lot of slot props are
available to render a UI that shows file progress. Make sure to call
`openFileSelector` using a user action like a button click.
When the file upload is complete, the `success` event is emitted with the File
document as JSON object.
::: info Note
The following example can't upload the file because it is not connected to a
Jingrow backend.
:::
handleFile(file)">
```vue
handleFile(file)">
```
## Props
| Name | Default | Value | Description |
| :------------- | :------ | :--------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `fileTypes` | `null` | `String` | String passed to `accept` attribute of file input. Use it to restrict file types to be uploaded. |
| `uploadArgs` | `null` | `Object` | See [uploadArgs](#uploadargs) |
| `validateFile` | `null` | `Function` | Validator function to validate the selected file. File object is passed as first parameter. Return an error message or throw an Error to prevent file upload. |
## `uploadArgs`
Options passed to `/api/action/upload_file` as arguments. Object structure looks
like this:
```js
{
private, folder, file_url, pagetype, docname, fieldname, method, type
}
```