Using Tika for mime type detection gives unexpected results
I am using Tika for detecting mime type by using this code
InputStream inputStream = file.getInputStream();
Tika tika = new Tika();
String mediaType= tika.detect(inputStream);
Now when I am uploading a doc file it is detecting it's mediatype as application/xhtml+xml , Although it should have detect it as application/msword , This is happening with some doc file only not all of them
链接地址: http://www.djcxy.com/p/45484.html上一篇: 限制名称大小和文件扩展