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.

FileNameGenerator 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.

Description

This sample demonstrates how to control and generate server filenames for files as they are uploaded. This is accomplished by using a FileNameGenerator. In this sample, the filename is generated by putting the file in a folder named for the first letter of the client filename. For more useful filename generators, you might use other information. For example:

  • The currently logged in username (available via HttpContext.Current.User.Identity.Name)
  • Data stored in session state (available via HttpContext.Current.Session)
  • Data passed via the UploadInformation string (accessible via HttpUploadModule.GetUploadStatus().UploadInformation)

To configure SlickUpload to use a FileNameGenerator, you set the following uploadStreamProvider key attributes:

  • fileNameMethod="Custom"
  • fileNameGenerator="<class reference to your FileNameGenerator>"

For this sample, the configuration is as follows:

<uploadStreamProvider ... fileNameMethod="Custom" fileNameGenerator="PrefixFolderFileNameGeneratorCS" ... />