You might be able to use the `file` command for determining this.
Activity
avleen commentedon Sep 16, 2012
Is this currently not working for you?
I just merged a patch to do
file -b, which should pull the correct content type.