

def serve_file(request, file, backend=None, save_as=False, content_type=None):
    handler = _load_backend(backend, SERVE_FILE_BACKEND)
    filename = file.name.rsplit('/')[(- 1)]
    if (save_as is True):
        save_as = filename
    if (not content_type):
        content_type = mimetypes.guess_type(filename)[0]
    return handler(request, file, save_as=save_as, content_type=content_type)

dataset/ETHPy150Open adieu/django-filetransfers/filetransfers/api.py serve_file/original