(self, path)
return 'application/octet-stream'
Guess the type of a file.

        Argument is a PATH (a filename).

        Return value is a string of the form type/subtype,
        usable for a MIME Content-type header.

        The default implementation looks the file's extension
        up in the table self.extensions_map, using application/octet-stream
        as a default; however it would be permissible (if
        slow) to look inside the data to make a better guess.
Guess the type of a file.
Guess the type of a file .
def guess_type(self, path):
        """Guess the type of a file.

        Argument is a PATH (a filename).

        Return value is a string of the form type/subtype,
        usable for a MIME Content-type header.

        The default implementation looks the file's extension
        up in the table self.extensions_map, using application/octet-stream
        as a default; however it would be permissible (if
        slow) to look inside the data to make a better guess.

        """
        base, ext = posixpath.splitext(path)
        if ext in self.extensions_map:
            return self.extensions_map[ext]
        ext = ext.lower()
        if ext in self.extensions_map:
            return self.extensions_map[ext]
        guess, _ = mimetypes.guess_type(path)
        if guess:
            return guess
        return 'application/octet-stream'
def guess_type ( self , path ) : base , ext = posixpath . splitext ( path ) if ext in self . extensions_map : return self . extensions_map [ ext ] ext = ext . lower ( ) if ext in self . extensions_map : return self . extensions_map [ ext ] guess , _ = mimetypes . guess_type ( path ) if guess : return guess return 'application/octet-stream'