Installing the Image Transformation Handler in a .NET Web application
To make the Image Transformation Handler work in .NET, add Contextual Image Delivery JARs and DLLs to the API (in-process) Server Role.
Procedure
- On the SDL Web installation media, navigate to Content Delivery\roles\cid\XXX\ (to be determined).
- From this location, extract the file XXX to a target folder of your choice.
- From the \bin\lib\ subfolder of your target folder, copy all files into the bin\lib\ folder of your API (in-process) .NET Web application.
- From the bin\ subfolder of your target folder, copy all files to the \bin\ folder of your .NET Web application.
- If you want to run the image transformer against a customized URL, access the bin\config\ folder of your Web application.
- Open cd_ambient_conf.xml for editing.
- In the
<ExcludedPaths>section, add a subelement<Path>/CUSTOM/PATH</Path>, where /CUSTOM/PATH refers to the customized URL that you want the image transformer to run against. - Save and close cd_ambient_conf.xml.
- In the root folder of your Web application, open Web.config for editing.
- Create a new handler mapping as follows (you can also copy-paste and then edit this section from the file Web_fragment.config located in the installation media folder configuration/samples/):
<location path="CUSTOM/PATH"> <system.webServer> <handlers> <add name="ImageTransformerHandler" verb="*" path="CUSTOM/PATH/*" type="Tridion.Context.Image.Handler.ImageTransformerHandler" /> </handlers> </system.webServer> </location>where /CUSTOM/PATH refers to the customized URL that you want the image transformer to run against. If you do not want to create a customized URL, omit the
pathattribute from thelocationelement and set to thepathattribute of theaddelement to*. - If you want to restrict access to the transformer, insert a
securitysection directly above thehandlerssection. - If you want to change the default response buffer size (4 MB) for images being transformed, add a
responseBufferLimitattribute to theaddelement and set it to the desired size in bytes. - If you wish to serve images from the local Web server, and if that host is not running on the default port (80), ensure that the
httpRuntimeelement inside thesystem.websection has an attributerequestPathInvalidCharactersset to the value shown below (you can also copy-paste and then edit this section from the file Web_fragment.config located in the installation media folder configuration/samples/):<system.web> <httpRuntime requestPathInvalidCharacters="<,>,*/%,&,\,?" /> </system.web> - Save and close Web.config.
- Start or restart your Web application.