Krystalware
SlickUpload logo

kw.FileSelector Class

Provides an interface for users to select files to upload.

Members

get_Id() – string

Gets the id of the current control.

add_OnFileAdding(handler)

Adds an event handler that fires before a file is added. If the handler returns false, the file will not be added.

Parameters

  • handler (function) – The function to call when this event is triggered.

Remarks

The handler recieves the following arguments:

  • file (File) – The file that will be added.

add_OnFileAdded(handler)

Adds an event handler that fires when a file is added.

Parameters

  • handler (function) – The function to call when this event is triggered.

Remarks

The handler recieves the following arguments:

  • file (File) – The file that was added.

add_OnFileRemoved(handler)

Adds an event handler that fires when a file is removed.

Parameters

  • handler (function) – The function to call when this event is triggered.

Remarks

The handler recieves the following arguments:

  • file (File) – The file that was removed.

get_Files()

Returns a File[], an array of File objects - one for each currently selected file.

set_MaxFiles(value)

Sets the maximum number of files that can be selected.

Parameters

  • value (int) – The maximum number of files that can be selected, or -1 for unlimited.

Remarks

If there are more files currently selected than the maximum number specified, they will be removed.

remove_File(id)

Removes a currently selected file.

Parameters

  • id (string) – The id of the file to remove.

clear()

Clears all files that have been selected

kw.FileSelector(id, dlContainerId, ulContainerId, maxFiles)

Initializes a new instance of the FileSelector class.

Parameters

  • id (string) – The id of the control.
  • dlContainerId (string) – The id of the html container template for downlevel file selection.
  • ulContainerId (string) – The id of the html container template for uplevel file selection.
  • maxFiles (int) – The maximum number of files that can be selected, or -1 for unlimited.