Installing the Image Transformation Handler in a .NET Web application
To make the Image Transformation Handler work in .NET, first install the API Server Role, then add CID JARs and DLLs to it.
Procedure
- If you have not already done so, create a .NET Web application containing the SDL Tridion Content Delivery Server Role called API. Refer to the SDL Tridion documentation to learn how.
- Access your CID installation media and navigate to Contextual Image Delivery\java\lib\.
- From this location, copy the following files to the \bin\lib\ folder of your .NET Web application:
- cwd_image.jar
- cwd_resource.jar
- Navigate to Tridion\Contextual Image Delivery\java\third-party-lib\.
- Copy the following files to your Web application library location:
- commmons-codec.jar
- httpclient.jar
- httpcore.jar
- On your CID installation media, navigate to dotNet\.
- From this location, copy the following files to the \bin\ folder of your .NET Web application:
- Tridion.Context.dll
- Tridion.Context.Image.dll
- Do one of the following:
- If you use Context Engine Cartridge, access the library location of the Context Engine Cartridge Web application.
- If you do not use Context Engine Cartridge, access the SDL Tridion Hotfix 87801 zip file.
- Copy the following files from this location to your Web application library location:
- cwd_cartridge.jar
- cwd_engine.jar
- Copy the file Tridion.Context.Interop.dll 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.