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?
InputStream
According to Real Gagnon's excellent site, the better solution for your case would be to use Apache Tika.