[ 
https://issues.apache.org/jira/browse/TIKA-1335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14031456#comment-14031456
 ] 

Chris A. Mattmann commented on TIKA-1335:
-----------------------------------------

Nick, I tried the --detect on the CDEC example KJ added:

{noformat}
[chipotle:tika/tika-app/target] mattmann% java -jar tika-app-1.6-SNAPSHOT.jar 
--detect $HOME/Desktop/CDEC_WEATHER_2010_03_02 
text/plain
{noformat}

this is with the latest example that you checked in. That doesn't seem to take 
care of the file, mainly I think b/c it's missing the extension. I realize that 
CSV is a sub-type of text/plain and this one is hard to detect - I wonder if we 
should put in like tab characters as early on MAGIC for CSV detection. there 
doesn't seem to be any MAGIC or precedence for this.

I tried on the .csv example, that seemed to work fine.

{noformat}
[chipotle:tika/tika-app/target] mattmann% java -jar tika-app-1.6-SNAPSHOT.jar 
--detect $HOME/Desktop/foo.csv 
text/csv
[chipotle:tika/tika-app/target] mattmann% 
{noformat}

I almost have a patch ready for TIKA-1336, I will be attaching it soon. It's a 
start at the detection JAX-RS interface. I'll update the wiki with docs and 
also am going to add a unit test. It doesn't seem to work though on the CDEC 
example for the same reason, however it works for csv.


> mime type for CSV files incorrectly detected as text/plain
> ----------------------------------------------------------
>
>                 Key: TIKA-1335
>                 URL: https://issues.apache.org/jira/browse/TIKA-1335
>             Project: Tika
>          Issue Type: Bug
>          Components: mime
>    Affects Versions: 1.5, 1.6
>            Reporter: Kaijian Xu
>            Assignee: Chris A. Mattmann
>         Attachments: CDEC_WEATHER_2010_03_02, foo.csv, velocity.csv
>
>
> Mime type autodetection returns "text/plain" for CSV files, for example:
> % tika -m foo.csv
> Content-Encoding: ISO-8859-1
> Content-Length: 78
> Content-Type: text/plain; charset=ISO-8859-1
> resourceName: foo.csv
> This occurs regardless of whether the filename has the appropriate *.csv 
> extension or not.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to