identify the file extension using java

后端 未结 3 1113
遇见更好的自我
遇见更好的自我 2021-01-19 18:46

i have different format files in DB. i want to copy to my local machine.

how can i identify the file format (doc, xls, etc...)

Regards, krishna

Than

3条回答
  •  孤城傲影
    2021-01-19 18:56

    You can use the Tika apache library. As Dmitri pointed out however, you may have incorrect results sometimes if detecting mime type from file headers or file extension.

提交回复
热议问题