title: How to check a uploaded file whether it is an image or other file?
body: <p>In my web application I have an image uploading module. I want to check the uploaded file whether it's an image file or any other file. I am using Java in server side.</p>
  
  <p>The image is read as <code>BufferedImage</code> in java and then I am writing it to disk with <code>ImageIO.write()</code></p>
  
  <p>How shall I check the <code>BufferedImage</code>, whether it's really an image or something else?</p>
  
  <p>Any suggestions or links would be appreciated.</p>