You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nutch.apache.org by "Sebastian Nagel (JIRA)" <ji...@apache.org> on 2014/02/21 22:35:28 UTC

[jira] [Updated] (NUTCH-1605) mime type detector recognizes xlsx as zip file

     [ https://issues.apache.org/jira/browse/NUTCH-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebastian Nagel updated NUTCH-1605:
-----------------------------------

    Attachment: NUTCH-1605-trunk-v1.patch

Patch for trunk which implements solution 1: pass URL (file name) and content type from server (HTTP protocol) to Tika.
It works if file suffix/extensions is in accordance with the MIME type:
{code}
% bin/nutch parsechecker http://localhost/test.xlsx
fetching: http://localhost/test.xlsx
parsing: http://localhost/test.xlsx
contentType: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
{code}

> mime type detector recognizes xlsx as zip file
> ----------------------------------------------
>
>                 Key: NUTCH-1605
>                 URL: https://issues.apache.org/jira/browse/NUTCH-1605
>             Project: Nutch
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.7
>            Reporter: Sebastian Nagel
>         Attachments: NUTCH-1605-trunk-v1.patch, test.xlsx
>
>
> With {{mime.type.magic}} as true (the default) Office Open XML spreadsheets (*.xlsx) are treated as zip files and not parsed correctly:
> {code}
> % bin/nutch parsechecker http://localhost/test.xlsx
> fetching: http://localhost/test.xlsx
> parsing: http://localhost/test.xlsx
> contentType: application/zip
> ...
> {code}
> Xlsx files are formally zip files. Nevertheless, both HTTP header and file name are clear:
> {code}
> % wget -d http://localhost/test.xlsx
> ...
> HTTP/1.1 200 OK
> ...
> Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
> ...
> {code}
> Tika 1.4 detects the type correctly:
> {code}
> % java -jar tika-app-1.4.jar -d http://localhost/test/test.xlsx
> application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)