public static function getType($extension) {
        foreach (self::$map as $mime => $exts) {
            if (in_array(strtolower($extension), $exts)) {
                return $mime;
            }
        }
        return null;
    }