IdentifyMimeType
Description
Attempts to identify the MIME Type used for a FlowFile. If the MIME Type can be identified, an attribute with the name 'mime.type' is added with the value being the MIME Type. If the MIME Type cannot be determined, the value will be set to 'application/octet-stream'. In addition, the attribute 'mime.extension' will be set if a common file extension for the MIME Type is known. If the MIME Type detected is of type text/*, attempts to identify the charset used and an attribute with the name 'mime.charset' is added with the value being the charset.
Tags
MIME, bzip2, compression, file, gzip, identify, mime.type, zip
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Use Filename In Detection * | use-filename-in-detection | true |
| If true will pass the filename to Tika to aid in detection. |
Config Strategy * | config-strategy | Preset |
| Select the loading strategy for MIME Type configuration to be used. |
Config Body | config-body | Body of MIME type config file. Only one of Config File or Config Body may be used. This property is only considered if:
| ||
Config File | config-file | Path to MIME type config file. Only one of Config File or Config Body may be used. Supports Expression Language, using Environment variables. This property is only considered if:
|
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
success | All FlowFiles are routed to success |
Reads Attributes
This processor does not read attributes.
Writes Attributes
Name | Description |
---|---|
mime.charset | This Processor sets the FlowFile's mime.charset attribute to the detected charset. If unable to detect the charset or the detected MIME type is not of type text/*, the attribute will not be set |
mime.extension | This Processor sets the FlowFile's mime.extension attribute to the file extension associated with the detected MIME Type. If there is no correlated extension, the attribute's value will be empty |
mime.type | This Processor sets the FlowFile's mime.type attribute to the detected MIME Type. If unable to detect the MIME Type, the attribute's value will be set to application/octet-stream |
State Management
This component does not store state.
Restricted
This component is not restricted.
Input Requirement
This component requires an incoming relationship.
System Resource Considerations
This component does not specify system resource considerations.