Mime Type library allows that you easily get mimetype with file's extension.
Geek Repo:Geek Repo
Github PK Tool:Github PK Tool