CATEGORY::filetype

Description

This iRules command checks for the mime type and mime subtype of an HTTP request payload and returns the values to specified variables; use one or both to specify them name of the variable that you want the value to be given to.

Syntax

CATEGORY::filetype <payload> -mimetype <variable1> -mimesubtype <variable2>

Examples

when HTTP_RESPONSE {
       # Collect 256 bytes of payload and trigger HTTP_RESPONSE_DATA
       HTTP::collect 256
}
when HTTP_RESPONSE_DATA {
       # Get the mime type and subtype for the payload
       CATEGORY::filetype [HTTP::payload 256] -mimetype type_var -mimesubtype subtype_var
       log local0. "Returned: type $type_var and subtype $subtype_var"
}