# Add File Format Detection

This section describes how to add file format detection, so that only image files are routed to Media Server.

To add file format detection

1. Add a processor, by dragging the processor icon from the components toolbar to the canvas.

   The Add Processor dialog box opens.

2. In the Source list, click idol.nifi.

3. Select the KeyViewRouteOnFileType processor and click ADD.

   The processor is added to the canvas.

4. Click the queue between the KeyViewExtractFiles and KeyViewFilterDocument processor.

   The queue is selected and handles appear so that you can modify the route.

5. Drag the blue destination handle from the KeyViewFilterDocument processor to the KeyViewRouteOnFileType processor.

6. Right-click the KeyViewRouteOnFileType processor and click Configure.

   The Configure Processor dialog box opens.

7. Click the Properties tab.
8. In the properties list, find the KeyView Filter Service property. Edit the property and select the KeyView filter service that you created in Add a KeyView Service.

9. Add a new property to route image files. With this processor, each property you create defines a new relationship (for more information, see the documentation for the KeyViewRouteOnFileType processor).

   1. Click Add property .

      The Add Property dialog box opens.

   2. Type a name for the property, for example `images`, and click OK.

      Another dialog box opens, so that you can set the value of the property.

   3. Specify the value `5,83,143,238` and click OK. These numbers are KeyView format codes (5 for BMP files, 83 for TIFF, 143 for JPEG, and 238 for PNG).

10. Click APPLY.

11. Create a connection between the KeyViewRouteOnFileType processor and the KeyViewFilterDocument processor.

    The Create Connection dialog box opens.

12. In the For Relationships area, select the unmatched and unknown check boxes:

    - unmatched - all file types that were successfully identified by KeyView, but did not match a property that you configured. In this example, this includes all files that were successfully identified but are not BMP, TIFF, JPEG, or PNG files.
    - unknown - all file types that KeyView could not identify.

13. Click ADD.

    The connection appears on the canvas. Any FlowFile that is processed successfully but does not represent a BMP, TIFF, JPEG, or PNG file is now routed to the KeyViewFilterDocument processor (as before). FlowFiles that represent one of the image formats are no longer routed to the KeyViewFilterDocument processor because you did not select the images relationship.

    The next section describes how to add media analysis to process the image files.

_FT_HTML5_bannerTitle.htm