How can I get MIME type of an InputStream of a file that is being uploaded?

前端 未结 8 1297
离开以前
离开以前 2020-12-30 21:51

Simple question: how can I get MIME type (or content type) of an InputStream, without saving file, for a file that a user is uploading to my servlet?

8条回答
  •  隐瞒了意图╮
    2020-12-30 22:17

    According to Real Gagnon's excellent site, the better solution for your case would be to use Apache Tika.

提交回复
热议问题