5

Possible Duplicate:
Getting A File’s Mime Type In Java

i am looking for some function / plugin that's doing what finfo\mime_content_type doing in php. an exemple : click here to see an image

but if you will download the image to your computer and open it like a .rar file (with win rar or something else), you will see an rar dictonary , with a file named "garfild" !

in PHP , finfo or mime_content_type would decide that's not an image (but other servises like GD functions , will find it like an image) , and i am searching some thing like this in JAVA. thank you very much :) sorry for my newbie english , i'm not from eslish-speaking country :)

Community
  • 1
  • 1

1 Answers1

0

You're looking for a library which is able to recognize a file's magic number, which is an indication for the actual file type. You could try jMimeMagic: http://sourceforge.net/projects/jmimemagic/ (as described in HowTo extract MimeType from a byte[])

Community
  • 1
  • 1
Rein
  • 478
  • 3
  • 3