Krystalware
SlickUpload logo

IIS 7 configuration

IIS 7 has introduces two major changes from earlier version of IIS that affect SlickUpload. First, IIS 7 Integrated Mode uses the <system.webServer> tag to configure HttpModules and HttpHandlers. Second, IIS 7 adds a request filtering module that controls request size. To configure your application to support SlickUpload under IIS 7, make the following changes to your web.config:

  • Move or copy the httpModule and httpHandler sections – Move or copy configuration from the <system.web> web.config section to the <system.webServer> section.
    1. If you will be running your application only on IIS 7, remove the existing SlickUpload references from the <system.web> httpModule and httpHandler sections.
    2. Add the following section to your web.config:
      <system.webServer>
          <handlers>
              <add name="SlickUploadHandler" path="SlickUpload.axd" verb="GET,POST" type="Krystalware.SlickUpload.SlickUploadHandler, Krystalware.SlickUpload" />
          </handlers>
          <modules>
              <add name="SlickUploadModule" type="Krystalware.SlickUpload.HttpUploadModule, Krystalware.SlickUpload" preCondition="managedHandler" />
          </modules>
      </system.webServer>
    3. If you will be running your application on both IIS 7 and earlier versions, add the following section inside the <system.webServer> section:
      <validation validateIntegratedModeConfiguration="false"/>
  • Add a configuration section to increase the request filtering allowed size
    Add the following section inside your <system.webServer> configuration section:
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="2072576000"/>
        </requestFiltering>
    </security>

    If you get an error such as "The requested page cannot be accessed because the related configuration data for the page is invalid" when you add the requestFiltering section to your web.config, you'll have to modify the IIS 7 applicationHost.config file to enable you to configure request filtering at the application level instead of the machine level. To do this, open the %windir%\System32\inetsrv\config\applicationHost.config file in a text editor and change the following line:

    <section name="requestFiltering" overrideModeDefault="Deny" />

    to read:

    <section name="requestFiltering" overrideModeDefault="Allow" />

    If you are in a hosted environment such that you can't manually change the applicationHost.config, request that your hosting provider makes the above change.