Skip to content
angulux
@anguless/angulux/fileupload

fileupload

2 declarations2 demos
import
import { FileUploadModule } from '@anguless/angulux/fileupload';

Basic

Basic mode is a single choose control; customUpload hands the files to your own code instead of posting them.

Choose a file No file chosen
<agl-fileUpload mode="basic" chooseLabel="Choose a file" accept="image/*" [maxFileSize]="1000000" [customUpload]="true" (uploadHandler)="onUpload($event)" /><span>{{ chosen() }}</span>

Advanced

The full control adds drag and drop, a file list and progress.

Choose

Drag and drop files here to upload.

<div style="width: 100%">    <agl-fileUpload [multiple]="true" accept="image/*" [maxFileSize]="1000000" [customUpload]="true" (uploadHandler)="onUpload($event)">        <ng-template #empty>            <p>Drag and drop files here to upload.</p>        </ng-template>    </agl-fileUpload></div>

API

Generated from the committed corpus, which check:corpus holds to the built library.

FileContent

component[aglFileContent]
InputTypeDefaultDescription
filesanynot documented
badgeSeverity'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast'not documented
badgeValuestringnot documented
previewWidthnumbernot documented
fileRemoveIconTemplateanynot documented
OutputTypeDescription
onRemoveany

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.

FileUpload

componentagl-fileupload, agl-fileUpload

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

InputTypeDefaultDescription
namestring | undefinednot documentedName of the request parameter to identify the files at backend.
urlstring | undefinednot documentedRemote url to upload the files.
method'post' | 'put' | undefinednot documentedHTTP method to send the files to the url such as "post" and "put".
multipleboolean | undefinednot documentedUsed to select multiple files at once from file dialog.
acceptstring | undefinednot documentedComma-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").
disabledboolean | undefinednot documentedDisables the upload functionality.
autoboolean | undefinednot documentedWhen enabled, upload begins automatically after selection is completed.
withCredentialsboolean | undefinednot documentedCross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates.
maxFileSizenumber | undefinednot documentedMaximum file size allowed in bytes.
invalidFileSizeMessageSummarystringnot documentedSummary message of the invalid file size.
invalidFileSizeMessageDetailstringnot documentedDetail message of the invalid file size.
invalidFileTypeMessageSummarystringnot documentedSummary message of the invalid file type.
invalidFileTypeMessageDetailstringnot documentedDetail message of the invalid file type.
invalidFileLimitMessageDetailstringnot documentedDetail message of the invalid file type.
invalidFileLimitMessageSummarystringnot documentedSummary message of the invalid file type.
style{ [klass: string]: any } | null | undefinednot documentedInline style of the element.
styleClassstring | undefinednot documentedClass of the element.
previewWidthnumbernot documentedWidth of the image thumbnail in pixels.
chooseLabelstring | undefinednot documentedLabel of the choose button. Defaults to AnguluxConfig Locale configuration.
uploadLabelstring | undefinednot documentedLabel of the upload button. Defaults to AnguluxConfig Locale configuration.
cancelLabelstring | undefinednot documentedLabel of the cancel button. Defaults to AnguluxConfig Locale configuration.
chooseIconstring | undefinednot documentedIcon of the choose button.
uploadIconstring | undefinednot documentedIcon of the upload button.
cancelIconstring | undefinednot documentedIcon of the cancel button.
showUploadButtonbooleannot documentedWhether to show the upload button.
showCancelButtonbooleannot documentedWhether to show the cancel button.
mode'advanced' | 'basic' | undefinednot documentedDefines the UI of the component.
headersHttpHeaders | undefinednot documentedHttpHeaders class represents the header configuration options for an HTTP request.
customUploadboolean | undefinednot documentedWhether to use the default upload or a manual implementation defined in uploadHandler callback. Defaults to AnguluxConfig Locale configuration.
fileLimitnumber | undefinednot documentedMaximum number of files that can be uploaded.
uploadStyleClassstring | undefinednot documentedStyle class of the upload button.
cancelStyleClassstring | undefinednot documentedStyle class of the cancel button.
removeStyleClassstring | undefinednot documentedStyle class of the remove button.
chooseStyleClassstring | undefinednot documentedStyle class of the choose button.
chooseButtonPropsButtonPropsnot documentedUsed to pass all properties of the ButtonProps to the choose button inside the component.
uploadButtonPropsButtonPropsnot documentedUsed to pass all properties of the ButtonProps to the upload button inside the component.
cancelButtonPropsButtonPropsnot documentedUsed to pass all properties of the ButtonProps to the cancel button inside the component.
filesnot documented
OutputTypeDescription
onBeforeUploadEventEmitter<FileBeforeUploadEvent>Callback to invoke before file upload is initialized.
onSendEventEmitter<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.
onUploadEventEmitter<FileUploadEvent>Callback to invoke when file upload is complete.
onErrorEventEmitter<FileUploadErrorEvent>Callback to invoke if file upload fails.
onClearEventEmitter<Event>Callback to invoke when files in queue are removed without uploading using clear all button.
onRemoveEventEmitter<FileRemoveEvent>Callback to invoke when a file is removed without uploading using clear button of a file.
onSelectEventEmitter<FileSelectEvent>Callback to invoke when files are selected.
onProgressEventEmitter<FileProgressEvent>Callback to invoke when files are being uploaded.
uploadHandlerEventEmitter<FileUploadHandlerEvent>Callback to invoke in custom upload mode to upload the files manually.
onImageErrorEventEmitter<Event>This event is triggered if an error occurs while loading an image file.
onRemoveUploadedFileEventEmitter<RemoveUploadedFileEvent>This event is triggered if an error occurs while loading an image file.
Template slotDescription
<ng-template #file>Custom file template.
<ng-template #header>Custom header template.
<ng-template #content>Custom content template.
<ng-template #toolbar>Custom toolbar template.
<ng-template #chooseicon>Custom choose icon template.
<ng-template #filelabel>Custom file label template.
<ng-template #uploadicon>Custom upload icon template.
<ng-template #cancelicon>Custom cancel icon template.
<ng-template #empty>Custom empty state template.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.