Krystalware
SlickUpload logo

kw.UploadConnector Class

Connects an HTML form with out of band uploads.

Members

get_Id() – string

Gets the id of the current control.

add_OnBeforeUpload(handler)

Adds an event handler that fires before the upload process starts.

Parameters

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

Remarks

The handler should return true to allow the upload to continue or false to cancel the upload.

add_OnUploadStarted(handler)

Adds an event handler that fires when the upload process has started.

Parameters

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

Remarks

The handler recieves a data parameter with the following properties:

  • fileCount: The number of files being uploaded.

add_OnUploadFileComplete(handler)

Adds an event handler that fires for each file after it has been uploaded.

Parameters

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

Remarks

The handler recieves a data parameter with the following properties:

  • fileName: The name of the file that was just completed.

add_OnUploadEnded(handler)

Adds an event handler that fires when the upload process has ended.

Parameters

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

Remarks

The handler recieves a data parameter with the following properties:

  • fileCount: The number of files being uploaded.
  • isSuccessful: true if the upload was completed successfully, false otherwise.
  • wasCancelled: true if the upload was cancelled, false otherwise.

cancel()

Cancels the upload submission process.

executeAfterUploadPostBack()

Executes the after upload postback.

submit(shouldValidate)

Starts the upload submission process.

Parameters

  • shouldValidate (bool) – A boolean that specifies whether to run validation before the upload process. If true, the upload will only be started if validation passes.

kw.UploadConnector(id, uploadId, formId, progressDisplayId, progressUrl, uploadUrl, autoUploadOnSubmit, autoSubmitAfterUpload, hasPostProcessStep, hideDuringUploadElements, showDuringUploadElements, confirmNavigateDuringUploadMessage)

Initializes a new instance of the UploadConnector class.

Parameters

  • id (string) – The id of the control.
  • uploadId (string) – The unique uploadId which identifies this upload instance.
  • formId (string) – The id of the form element to manage.
  • progressDisplayId (string) – The id of the progress display associated with this UploadConnector, or null if no progress display exists.
  • progressUrl (string) – The URL to access to get progress information.
  • uploadUrl (string) – The URL to post to for the upload.
  • autoUploadOnSubmit (bool) – A boolean that specifies whether to automatically start an upload when the associated form is submitted.
  • autoSubmitAfterUpload (bool) – A boolean that specifies whether to automatically submit the associated form after an upload is complete.
  • hasPostProcessStep (bool) – A boolean that specifies whether this upload has a post processing step.
  • hideDuringUploadElements (string[]) – An array of the ids of elements to hide during the upload process, or null.
  • showDuringUploadElements (string[]) – An array of the ids of elements to show during the upload process, or null.
  • confirmNavigateDuringUploadMessage (string) – A message to display if the user attempts to navigate away during an upload, confirming the user wants to cancel.