import mimetypes


def get_content_type(filename):
    """
    Use the python mimetypes to determine a mime type, or return application/octet-stream
    """
    return mimetypes.guess_type(filename)[0] or 'application/octet-stream'