kor TürkçeGitHub

FileDrop

Accepts file selections and displays application-managed progress or errors.

kor/ui/FileDropSource

When to use

  • Collect attachments while the application owns validation and upload.

Examples

Choose a PDF

Loading the example

<k:FileDrop label="Packing slip" accept=".pdf" maxSize="5" add=".onAdd"/>

Manage inspection attachments

This example simulates upload completion locally. Choose a PDF or an image, then remove an entry or retry the failed one.

Loading the example

<k:FileDrop label="Inspection attachments" accept=".pdf,image/*" maxSize="5"
	multiple="true" add=".onAdd" remove=".onRemove" retry=".onRetry">
	<k:FileItem name="inspection.pdf" size="2048" error="Upload interrupted"/>
</k:FileDrop>

API

Properties

NameTypeDefaultDescription
labelstringField label
helpstringSupporting text
acceptstringAccepted types or extensions, for example .pdf,image/*
maxSizefloat0Maximum size in MB. Zero means unlimited
multiplebooleantrueWhether multiple files can be selected
enabledbooleantrueWhether file selection is enabled

Aggregations

NameTypeDescription
filesFileItem[]Files and their upload status

Events

NameTypeDescription
addfiles: objectAccepted files were selected
removeitem: kor.ui.FileItemThe user requested removal of a file
retryitem: kor.ui.FileItemThe user requested a retry of a failed upload

FileItem

A file entry with upload status.

Properties

NameTypeDefaultDescription
keystringFile key
namestringFilename
sizefloat0Size in bytes
progressfloat100Upload progress as a percentage
errorstringUpload error message

Related

FormMessageList