1

Ive got a following code for recognizing image types in Java from another post here on stackoverflow.

FileNameMap fileNameMap = URLConnection.getFileNameMap();
String mimeType = fileNameMap.getContentTypeFor(path);
System.out.println(mimeType);

It works fine , for jpeg , gif or png.

But the output for BMP picture is NULL. Anyone help ? :)

Matej Špilár
  • 2,617
  • 3
  • 15
  • 28
  • Found [this comment](http://stackoverflow.com/questions/51438/getting-a-files-mime-type-in-java#comment27442076_6899179). Tried running your snippet with Java 6 and 8, and it worked on 8 but not 6. – avojak Aug 01 '16 at 18:11

0 Answers0