Krystalware

SlickUpload Demos

» Overview Demonstrates the basics of SlickUpload. Selecting files, maximum file limit, file type validation, require files to be selected.
» FileNameGenerator How to control and generate server filenames for files as they are uploaded.
» Additional Fields How to add additional input fields for each selected file.
» Custom Progress Display custom progress information during a postprocessing step after files are uploaded.
» Localization How to localize the SlickUpload control.
» Modal Progress Show the progress display in a modal.
» Skinned Skin the file list and progress display.
» Upload to Amazon S3 How to upload to Amazon's Simple Storage Service with progress display.
» Upload to SQL Server Upload directly to a SQL Server, streaming with no memory usage.
Clustered» Use a StatusManager configuration to allow uploads with progress to a cluster/web farm/web garden.
» Custom UploadStreamProvider How to develop your own upload stream provider – this example shows how to zip files as they are uploaded.
» SimpleThe bare metal SlickUpload control, drag-dropped onto the page.

Clustered Sample

To see this sample in action, download the SlickUpload package and configure it for your environment.

NOTE: the maximum allowed request size for this sample is 1000 MB. If you attempt to upload files larger than this, you will recieve a oversized upload error which SlickUpload will handle gracefully. This is controlled by the maxRequestLength attribute of the httpRuntime key in the web.config file.

Configuration

Configuration for the status manager sample involves creating the status database and table and configuring SlickUpload to point at that database. To do this, perform the following steps:

  1. Create a new database, or select an existing database to use
  2. Open and run the UploadStatusTable.sql script in the SlickUpload distribution package root folder on the selected database
  3. Uncomment the statusManager section in the root web.config. This section is only valid at the root of an application.
  4. Change the connection string in the statusManager web.config section to point to the database selected above

Description

In clustered environments with multiple boxes or application instances, an upload may be handled by one instance with the progress requests being handled by another instance and the final postback by yet another instance. To handle this environment, SlickUpload includes a status management architecture for centralizing the upload status information. By default, the upload status is stored in application state (via the ApplicationStateStatusManager). SlickUpload includes a SqlClientStatusManager that stores the upload status in a central SQL Server database, as well as the capability to extend to use a custom status manager.

This sample covers the configuration and use of the SQL Server status manager. To use this instead of the default ApplicationStateStatusManager, use a statusManager web.config configuration section like the following:

<statusManager manager="SqlClient"
    connectionString="server=.;uid=xxx;pwd=xxx;database=xxx;"
    table="UploadStatus" keyField="UploadId" statusField="UploadStatus" lastUpdatedField="LastUpdated"
    updateInterval="1" />

You can use other table and field names by changing them in the database and setting them in the SlickUpload configuration. This configuration is the default, built around the provided UploadStatusTable.sql schema.

NOTE: when looking at the status table during uploads in this sample, you may see extra orphan status records. This is because the sample architecture causes page postbacks to be handled as uploads. In a production application where uploads are directed only to the specified SlickUpload handler, orphan records won't be created. SlickUpload also includes an abandoned upload sweeper that eliminates orphaned status records every 10 minutes.