0

I need to detect the document type of the given file. I did it using magic numbers for pdf,RTF, doc files. but whenever I tried to do the same on odt and docx files, unfortunately, I can't because the magic number for both are same. Please help me to sort this issue. I need the answer programmatically in java Thanks in advance.

1 Answers1

0

What I just tried now :

$ file file.docx
file.docx: Microsoft OOXML
$ file file.odt
file.odt: OpenDocument Text
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223