UploadInput

open class UploadInput(uploadUrl: String?, multiple: Boolean, className: String?, init: UploadInput.() -> Unit?)

The file upload component.

Parameters

uploadUrl

the optional URL for the upload processing action

multiple

determines if multiple file upload is supported

className

CSS class names

init

an initializer extension function

Constructors

UploadInput
Link copied to clipboard
fun UploadInput(uploadUrl: String? = null, multiple: Boolean = false, className: String? = null, init: UploadInput.() -> Unit? = null)

Types

Companion
Link copied to clipboard
object Companion

Functions

afterDestroy
Link copied to clipboard
open fun afterDestroy()
afterInsert
Link copied to clipboard
open fun afterInsert(node: <ERROR CLASS>)
bindAllJQueryListeners
Link copied to clipboard
open fun bindAllJQueryListeners()
buildAttributeSet
Link copied to clipboard
open fun buildAttributeSet(attributeSetBuilder: <ERROR CLASS>)
buildClassSet
Link copied to clipboard
open fun buildClassSet(classSetBuilder: <ERROR CLASS>)
cancel
Link copied to clipboard
open fun cancel()

Cancel an ongoing ajax upload (only for ajax mode).

clearInput
Link copied to clipboard
open fun clearInput()

Clears the file input control (including the native input).

getNativeFile
Link copied to clipboard
fun getNativeFile(kFile: <ERROR CLASS>): <ERROR CLASS>?

Returns the native JavaScript File object.

getState
Link copied to clipboard
open fun getState(): List<<ERROR CLASS>>?
getValueAsString
Link copied to clipboard
fun getValueAsString(): String?

Returns the value of the file input control as a String.

lock
Link copied to clipboard
open fun lock()

Locks the file input (disabling all buttons except a cancel button).

removeAllJQueryListeners
Link copied to clipboard
open fun removeAllJQueryListeners()
render
Link copied to clipboard
open fun render(): <ERROR CLASS>
resetInput
Link copied to clipboard
open fun resetInput()

Resets the file input control.

setState
Link copied to clipboard
open fun setState(state: List<<ERROR CLASS>>?)
subscribe
Link copied to clipboard
open fun subscribe(observer: (List<<ERROR CLASS>>?) -> Unit): () -> Unit
unlock
Link copied to clipboard
open fun unlock()

Unlocks the file input.

upload
Link copied to clipboard
open fun upload()

Trigger ajax upload (only for ajax mode).

Properties

ajaxSettings
Link copied to clipboard
var ajaxSettings: dynamic

Additional ajax settings to pass to the plugin before submitting the ajax request for upload.

allowedFileExtensions
Link copied to clipboard
var allowedFileExtensions: Set<String>?

Allowed file extensions.

allowedFileTypes
Link copied to clipboard
var allowedFileTypes: Set<String>?

Allowed file types.

browseOnZoneClick
Link copied to clipboard
var browseOnZoneClick: Boolean

Determines if the click on the preview zone opens file browse window.

disabled
Link copied to clipboard
open var disabled: <ERROR CLASS>

Determines if the field is disabled.

dropZoneEnabled
Link copied to clipboard
var dropZoneEnabled: Boolean

Determines if Drag&Drop zone is enabled.

explorerTheme
Link copied to clipboard
var explorerTheme: Boolean

Determines if the explorer theme is used.

hideThumbnailContent
Link copied to clipboard
var hideThumbnailContent: Boolean

Whether to hide the preview content (image, pdf content, text content, etc.) within the thumbnail.

maxFileSize
Link copied to clipboard
var maxFileSize: Double?

The maximum file size for upload in KB.

minFileSize
Link copied to clipboard
var minFileSize: Double?

The minimum file size for upload in KB.

multiple
Link copied to clipboard
var multiple: Boolean

Determines if multiple file upload is supported.

name
Link copied to clipboard
open var name: String?

The name attribute of the generated HTML input element.

placeholder
Link copied to clipboard
var placeholder: String?

The placeholder for the upload control.

preferIconicPreview
Link copied to clipboard
var preferIconicPreview: Boolean

Determines if the iconic preview is prefered.

required
Link copied to clipboard
var required: Boolean

Determines if the input selection is required.

showBrowse
Link copied to clipboard
var showBrowse: Boolean

Determines if the file browse button is shown.

showCancel
Link copied to clipboard
var showCancel: Boolean

Determines if the cancel button is shown.

showCaption
Link copied to clipboard
var showCaption: Boolean

Determines if the caption is shown.

showPreview
Link copied to clipboard
var showPreview: Boolean

Determines if the preview is shown.

showRemove
Link copied to clipboard
var showRemove: Boolean

Determines if the remove button is shown.

showUpload
Link copied to clipboard
var showUpload: Boolean

Determines if the upload button is shown.

showUploadStats
Link copied to clipboard
var showUploadStats: Boolean

Whether to to display the file upload statistics.

size
Link copied to clipboard
open var size: <ERROR CLASS>?

The size of the input (currently not working)

uploadAsync
Link copied to clipboard
var uploadAsync: Boolean

Whether the batch upload of multiple files will be asynchronous/in parallel.

uploadExtraData
Link copied to clipboard
var uploadExtraData: (String, Int) -> dynamic?

The extra data that will be passed as data to the AJAX server call via POST.

uploadUrl
Link copied to clipboard
var uploadUrl: String?

The optional URL for the upload processing action. If not set the upload button action will default to form submission.

validationStatus
Link copied to clipboard
open var validationStatus: <ERROR CLASS>?

The validation status of the input.

value
Link copied to clipboard
open var value: List<<ERROR CLASS>>?

File input value.