Skip to content

SiFileDropzoneComponent documentation

import { SiFileDropzoneComponent } from '@siemens/element-ng/file-uploader';

Input Properties

Name Type Default Description
accept
string | undefined

Define which file types are suggested in file browser.

See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#attr-accept

acceptText
TranslatableString $localize`:@@SI_FILE_UPLOADER.ACCEPTED_FILE_TYPES:Accepted file types: {{accept}}.`

Text or translation key for accepted types.

directoryUpload
boolean false

Enable directory upload.

errorTextFileMaxSize
TranslatableString $localize`:@@SI_FILE_UPLOADER.ERROR_FILE_SIZE_EXCEEDED:Max. {{maxFileSize}}`

Message or translation key if file exceeds the maximum file size limit.

errorTextFileType
TranslatableString $localize`:@@SI_FILE_UPLOADER.ERROR_FILE_TYPE:Invalid file type`

Text or translation key of message title if incorrect file type is dragged / dropped.

maxFileSize
number | undefined

Define maximal allowed file size in bytes.

maxFileSizeText
TranslatableString $localize`:@@SI_FILE_UPLOADER.MAX_SIZE:Upload max. {{maxFileSize}}`

Text or translation key for max file size.

multiple
boolean false

Defines whether the file input allows selecting multiple files. When directoryUpload is enabled, this will have no effect.

uploadDropText
TranslatableString $localize`:@@SI_FILE_UPLOADER.DROP:Drop files here or click to upload`

Text or translation key of the drag&drop field.

Output Properties

Name Type Description
fileError
FileUploadError

Event emitted when file validation errors occur, including files that were ignored due to size or type.

filesAdded
UploadFile[]

Event emitted when valid files are added. Invalid files are also included here, but with status 'invalid' and an errorText describing why they were ignored.

Attributes and Methods

Name Type Description
reset()
() => void

Reset all the files inside the native file input (and therefore the dropzone).

Types Documentation

import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';

Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit. Equivalent to a normal string in usage and functionality.

import type { FileUploadError } from '@siemens/element-ng/file-uploader';
Properties

import type { UploadFile } from '@siemens/element-ng/file-uploader';
Properties


Except where otherwise noted, content on this site is licensed under MIT License.