# fileupload

```ts
import { FileUploadModule } from '@anguless/angulux/fileupload';
```

## FileContent

`[aglFileContent]` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `files` | `any` | _not documented_ |  |
| `badgeSeverity` | `'secondary' \| 'info' \| 'success' \| 'warn' \| 'danger' \| 'contrast'` | _not documented_ |  |
| `badgeValue` | `string` | _not documented_ |  |
| `previewWidth` | `number` | _not documented_ |  |
| `fileRemoveIconTemplate` | `any` | _not documented_ |  |

| Output | Type | Description |
| --- | --- | --- |
| `onRemove` | `any` |  |

## FileUpload

`agl-fileupload, agl-fileUpload` — component

Inherits every input, output and slot of `BaseComponent` — see [basecomponent.md](basecomponent.md).

FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `name` | `string \| undefined` | _not documented_ | Name of the request parameter to identify the files at backend. |
| `url` | `string \| undefined` | _not documented_ | Remote url to upload the files. |
| `method` | `'post' \| 'put' \| undefined` | _not documented_ | HTTP method to send the files to the url such as "post" and "put". |
| `multiple` | `boolean \| undefined` | _not documented_ | Used to select multiple files at once from file dialog. |
| `accept` | `string \| undefined` | _not documented_ | Comma-separated list of pattern to restrict the allowed file types. Can be any combination of either the MIME types (such as "image/*") or the file extensions (such as ".jpg"). |
| `disabled` | `boolean \| undefined` | _not documented_ | Disables the upload functionality. |
| `auto` | `boolean \| undefined` | _not documented_ | When enabled, upload begins automatically after selection is completed. |
| `withCredentials` | `boolean \| undefined` | _not documented_ | Cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. |
| `maxFileSize` | `number \| undefined` | _not documented_ | Maximum file size allowed in bytes. |
| `invalidFileSizeMessageSummary` | `string` | _not documented_ | Summary message of the invalid file size. |
| `invalidFileSizeMessageDetail` | `string` | _not documented_ | Detail message of the invalid file size. |
| `invalidFileTypeMessageSummary` | `string` | _not documented_ | Summary message of the invalid file type. |
| `invalidFileTypeMessageDetail` | `string` | _not documented_ | Detail message of the invalid file type. |
| `invalidFileLimitMessageDetail` | `string` | _not documented_ | Detail message of the invalid file type. |
| `invalidFileLimitMessageSummary` | `string` | _not documented_ | Summary message of the invalid file type. |
| `style` | `{ [klass: string]: any } \| null \| undefined` | _not documented_ | Inline style of the element. |
| `styleClass` | `string \| undefined` | _not documented_ | Class of the element. |
| `previewWidth` | `number` | _not documented_ | Width of the image thumbnail in pixels. |
| `chooseLabel` | `string \| undefined` | _not documented_ | Label of the choose button. Defaults to AnguluxConfig Locale configuration. |
| `uploadLabel` | `string \| undefined` | _not documented_ | Label of the upload button. Defaults to AnguluxConfig Locale configuration. |
| `cancelLabel` | `string \| undefined` | _not documented_ | Label of the cancel button. Defaults to AnguluxConfig Locale configuration. |
| `chooseIcon` | `string \| undefined` | _not documented_ | Icon of the choose button. |
| `uploadIcon` | `string \| undefined` | _not documented_ | Icon of the upload button. |
| `cancelIcon` | `string \| undefined` | _not documented_ | Icon of the cancel button. |
| `showUploadButton` | `boolean` | _not documented_ | Whether to show the upload button. |
| `showCancelButton` | `boolean` | _not documented_ | Whether to show the cancel button. |
| `mode` | `'advanced' \| 'basic' \| undefined` | _not documented_ | Defines the UI of the component. |
| `headers` | `HttpHeaders \| undefined` | _not documented_ | HttpHeaders class represents the header configuration options for an HTTP request. |
| `customUpload` | `boolean \| undefined` | _not documented_ | Whether to use the default upload or a manual implementation defined in uploadHandler callback. Defaults to AnguluxConfig Locale configuration. |
| `fileLimit` | `number \| undefined` | _not documented_ | Maximum number of files that can be uploaded. |
| `uploadStyleClass` | `string \| undefined` | _not documented_ | Style class of the upload button. |
| `cancelStyleClass` | `string \| undefined` | _not documented_ | Style class of the cancel button. |
| `removeStyleClass` | `string \| undefined` | _not documented_ | Style class of the remove button. |
| `chooseStyleClass` | `string \| undefined` | _not documented_ | Style class of the choose button. |
| `chooseButtonProps` | `ButtonProps` | _not documented_ | Used to pass all properties of the ButtonProps to the choose button inside the component. |
| `uploadButtonProps` | `ButtonProps` | _not documented_ | Used to pass all properties of the ButtonProps to the upload button inside the component. |
| `cancelButtonProps` | `ButtonProps` | _not documented_ | Used to pass all properties of the ButtonProps to the cancel button inside the component. |
| `files` | `` | _not documented_ |  |

| Output | Type | Description |
| --- | --- | --- |
| `onBeforeUpload` | `EventEmitter<FileBeforeUploadEvent>` | Callback to invoke before file upload is initialized. |
| `onSend` | `EventEmitter<FileSendEvent>` | An event indicating that the request was sent to the server. Useful when a request may be retried multiple times, to distinguish between retries on the final event stream. |
| `onUpload` | `EventEmitter<FileUploadEvent>` | Callback to invoke when file upload is complete. |
| `onError` | `EventEmitter<FileUploadErrorEvent>` | Callback to invoke if file upload fails. |
| `onClear` | `EventEmitter<Event>` | Callback to invoke when files in queue are removed without uploading using clear all button. |
| `onRemove` | `EventEmitter<FileRemoveEvent>` | Callback to invoke when a file is removed without uploading using clear button of a file. |
| `onSelect` | `EventEmitter<FileSelectEvent>` | Callback to invoke when files are selected. |
| `onProgress` | `EventEmitter<FileProgressEvent>` | Callback to invoke when files are being uploaded. |
| `uploadHandler` | `EventEmitter<FileUploadHandlerEvent>` | Callback to invoke in custom upload mode to upload the files manually. |
| `onImageError` | `EventEmitter<Event>` | This event is triggered if an error occurs while loading an image file. |
| `onRemoveUploadedFile` | `EventEmitter<RemoveUploadedFileEvent>` | This event is triggered if an error occurs while loading an image file. |

| Slot | Read as | Description |
| --- | --- | --- |
| `<ng-template #file>` | `fileTemplate` | Custom file template. |
| `<ng-template #header>` | `headerTemplate` | Custom header template. |
| `<ng-template #content>` | `contentTemplate` | Custom content template. |
| `<ng-template #toolbar>` | `toolbarTemplate` | Custom toolbar template. |
| `<ng-template #chooseicon>` | `chooseIconTemplate` | Custom choose icon template. |
| `<ng-template #filelabel>` | `fileLabelTemplate` | Custom file label template. |
| `<ng-template #uploadicon>` | `uploadIconTemplate` | Custom upload icon template. |
| `<ng-template #cancelicon>` | `cancelIconTemplate` | Custom cancel icon template. |
| `<ng-template #empty>` | `emptyTemplate` | Custom empty state template. |
