identify the file extension using java

后端 未结 3 1137
遇见更好的自我
遇见更好的自我 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条回答
  •  Happy的楠姐
    2021-01-19 19:08

    How are the files stored? Do you have filenames with extensions, or just the binary data?

    Mime Util has tools to detect format both from extensions and from magic headers, but of course that's never 100%.

提交回复
热议问题