Krystalware
SlickUpload logo

SlickUpload control

The SlickUpload control is the central control that powers SlickUpload's client functionality. It provides functionality for file selection, listing selected files, file validation, showing a progress display during uploading, handling the files server side once the upload has completed. The SlickUpload control composes the other four controls included with SlickUpload (FileSelector, FileList, UploadProgressDisplay, and UploadConnector) into one easy to use package. For more advanced scenarios, the other controls can be used seperately.

» Control Server Reference

Control sections

The SlickUpload control is made up of the following sections:

  • FileSelector – The file selector allows multiple or single selection of files, depending on settings.
  • FileList – The file list displays files that have been selected, along with validation information and remove buttons as configured.
  • UploadProgressDisplay – The upload progress display shows progress information during an upload.
  • UploadConnector (not shown) – The upload connector is a non-ui control that manages connecting the other controls together and performing the actual upload.

How to

Control when uploading occurs

By default, the SlickUpload control handles all form submissions on the page it is on. You can turn this behavior off if you want to control this manually. To do this:

  1. Set the AutoUploadOnPostBack="false" attribute on the SlickUpload control
  2. When you are ready to upload, call the submit function on the SlickUpload control. This would look something like:
    kw.get("SlickUploadControlID").submit();
    NOTE: if you are calling the submit function in an OnClientClick handler, make sure to append return false to the handler so that ASP.NET doesn't immediately post back the page, cancelling the upload. For example:
    <asp:Button ... OnClientClick="kw.get('SlickUploadControlID').submit();return false;" ... />

Limit the number of files that can be selected

To limit the number of files, set the MaxFiles attribute on the SlickUpload control to the maximum number of files that may be selected. The default is -1 which means an unlimited amount of files.

<kw:SlickUpload ... MaxFiles="3" ... />