def GetContentType(filename):
 return (mimetypes.guess_type(filename)[0] or 'application/octet-stream')

def GetContentType ( filename ) : return ( mimetypes . guess_type ( filename ) [ 0 ] or 'application/octet-stream' )
helper to guess the content-type from the filename .