Image Resizer 1.2 - Web.config Friday, November 21, 2008

Version 1.2 of the image resizer is much easier to install in web.config, since it is implemented as an HttpModule instead of an HttpHandler. It still integrates quite well with ASP.NET's URL authorization system, and doesn't allow access to protected files.

This integration isn't valuable to most people, however, since they aren't protecting any static files. Users who don't need this protection can enable the "AllowFolderResizeNotation" setting to gain additional URL flexibility in exchange.

Version 1.2 now passes *all* file serving work back to IIS. The cached image is now written to disk first rather than last, allowing a simple RewritePath call to handle the work.

The same code can now be used for both IIS5, 6, 7c and 7i. The httpModules section handles IIS5/6/7c, and the modules section handles IIS7 integrated mode.

<system.web>
  ...
  <httpModules>
    <add name="ImageResizer" type="fbs.ImageResizer.InterceptModule"/>
  </httpModules>
  ...
</system.web>
<system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>
  ...
  <modules>
    <add name="ImageResizer" type="fbs.ImageResizer.InterceptModule"/>
  </modules>
</system.webServer>