tikaondotnet
tikaondotnet copied to clipboard
EML file is detected as text/plain
Hi,
We're facing an issue where TikaDotNet is not able to recognize correct MimeType for the attached EML file. When I process the same file through lastest Tika GUI, it outputs Content-Type: message/rfc822 correctly. Below is my code which I used to detect MimeType with TikaDotNet. Any hint/help would be greatly appreciated.
TikaConfig config = TikaConfig.getDefaultConfig();
Metadata meta = new Metadata();
meta.add("ResourceName", existingFile.SourceFileName);
meta.add("FilePath", existingFile.SourcePath);
Detector detector = config.getDetector();
TikaInputStream inputStream = TikaInputStream.@get(header, meta);
MediaType type = detector.detect(inputStream, meta);
Please change the attached file extension to ".eml" before testing out.
Thanks test.txt