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.

Additional Details...

Tags:

compression, gzip, bzip2, zip, MIME, mime.type, file, identify

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Use Filename In Detectionuse-filename-in-detectiontrue
  • true
  • false
If true will pass the filename to Tika to aid in detection.
Config Strategyconfig-strategyPreset
  • Preset Use default NiFi MIME Types.
  • Replace Use config MIME Types only.
  • Merge Use config together with default NiFi MIME Types.
Select the loading strategy for MIME Type configuration to be used.
Config Bodyconfig-bodyBody of MIME type config file. Only one of Config File or Config Body may be used.

This Property is only considered if the [Config Strategy] Property is set to one of the following values: [Replace], [Merge]
Config Fileconfig-filePath to MIME type config file. Only one of Config File or Config Body may be used.
Supports Expression Language: true (will be evaluated using Environment variables only)

This Property is only considered if the [Config Strategy] Property is set to one of the following values: [Replace], [Merge]

Relationships:

NameDescription
successAll FlowFiles are routed to success

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
mime.typeThis 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
mime.extensionThis 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.charsetThis 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

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:

None specified.