On my Centos server Python's mimetypes.guess_type("mobile.3gp") returns (None, None), instead of ('video/3gpp', None).
Where does Python get the list of mimetypes from, and is it possible to add a missing type to the list?
On my Centos server Python's mimetypes.guess_type("mobile.3gp") returns (None, None), instead of ('video/3gpp', None).
Where does Python get the list of mimetypes from, and is it possible to add a missing type to the list?
On my system (Debian lenny) its in /usr/lib/python2.5/mimetypes.py
in the list knownfiles
you can supply your own files for the init()
function.
The mimetypes module uses mime.types files as they are common on Linux/Unix systems. If you look in mimetypes.knownfiles you will find a list of files that Python tries to access to load the data. You can also specify your own file to add new types by adding it to that list.