get_mimetype(reference)
Static Method
|
|
Try to guess the mimetype for a resource, given the resource itself
and its name. To guess from the name we need to extract the type
extension, we use an heuristic for this task, but it needs to be improved
because there are many patterns:
<name> README
<name>.<type> index.html
<name>.<type>.<language> index.html.en
<name>.<type>.<language>.<encoding>
index.html.en.UTF-8 <name>.<type>.<compression>
itools.tar.gz etc...
And even more complex, the name could contain dots, or the filename
could start by a dot (a hidden file in Unix systems).
XXX Use magic numbers too (like file -i).
- Overrides:
vfs.itools.vfs.base.BaseFS.get_mimetype
- (inherited documentation)
|