【问题标题】:How to differentiate .odt and .docx file apart from magic number and extension如何区分 .odt 和 .docx 文件与幻数和扩展名
【发布时间】:2019-08-20 20:15:27
【问题描述】:

我需要检测给定文件的文档类型。我使用 pdf、RTF、doc 文件的幻数来做到这一点。但不幸的是,每当我尝试对 odt 和 docx 文件执行相同操作时,我都做不到,因为两者的幻数相同。请帮我解决这个问题。我需要在 java 中以编程方式回答 提前致谢。

【问题讨论】:

    标签: file file-type magic-numbers document-types


    【解决方案1】:

    我现在刚刚尝试的:

    $ file file.docx
    file.docx: Microsoft OOXML
    $ file file.odt
    file.odt: OpenDocument Text
    

    【讨论】:

      猜你喜欢
      • 2013-12-19
      • 1970-01-01
      • 2011-05-17
      • 2013-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-17
      • 1970-01-01
      相关资源
      最近更新 更多