With SlickUpload 6, we've simplified the configuration while making it more powerful. One of our main areas of focus was making it easy to create multiple upload pages with different upload configurations.
First off, we've removed a couple of things:
- The SlickUpload HttpHandler has been removed. It's now handled by the SlickUpload module.
- The maxRequestLength and executionTimeout settings have been moved into the SlickUpload configuration. You don't need to use the httpRuntime tag anymore. If you're using IIS7, you do still need to set maxAllowedContentLength on the system.webServer/security/requestFiltering/requestLimits tag.
- SlickUpload handling is now off by default except for the SlickUpload.axd handler. This means that SlickUpload won't interfere with other normal uploads on your site
Then, we added the concept of upload profiles. An upload profile is a bundle of upload settings, such as file storage location, max upload size, etc. You can then specify the upload profile to use for any SlickUpload upload control. This allows you to easily have multiple pages uploading to different locations, or even to different providers. For example, one page could upload to disk, and one could upload to a SQL database.
Here's an example web.config configured with SlickUpload 6 using all of these features:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="slickUpload" type="Krystalware.SlickUpload.Configuration.SlickUploadSection, Krystalware.SlickUpload" requirePermission="false" />
</configSections>
<slickUpload>
<uploadProfiles defaultProfile="default">
<add name="default" maxRequestLength="1020000" executionTimeout="3600">
<uploadStreamProvider type="File" location="~/Files" existingAction="Overwrite" />
</add>
</uploadProfiles>
</slickUpload>
<system.web>
<httpModules>
<add name="SlickUploadModule" type="Krystalware.SlickUpload.Web.SlickUploadModule, Krystalware.SlickUpload" />
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="SlickUploadModule" type="Krystalware.SlickUpload.Web.SlickUploadModule, Krystalware.SlickUpload" preCondition="managedHandler" />
</modules>
</system.webServer>
<!-- Enable large requests to SlickUpload's handler -->
<location path="SlickUpload.axd">
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2072576000" />
</requestFiltering>
</security>
</system.webServer>
</location>
</configuration>
If you've used SlickUpload before, you'll notice that this is much simpler and easier to configure. If you're new to SlickUpload, enjoy the straightforward configuration.
Note the upload profile above with name="default". This configuration only has one upload profile, so upload controls will use it by default. To add an additional upload profile, you would just copy/paste the <add> tag, configure it as you wish, and name it a different name.