Determine if the document is DOC or DOCX in Java app without knowing its extension
Posted
by Andriy
on Stack Overflow
See other posts from Stack Overflow
or by Andriy
Published on 2010-06-11T14:21:58Z
Indexed on
2010/06/11
14:22 UTC
Read the original article
Hit count: 365
There is a constraint in the content management system that requires to store all word documents with specific extension (different from DOC or DOCX). However, when outputting the document to user we need to know if it is a DOC or DOCX file in order to provide the right MIME type.
So, is there a way to programatically find out if document is DOC or DOCX by its content?
© Stack Overflow or respective owner