def METHOD_NAME(use_transfer, filename):
    if use_transfer:
        fpath = os.path.join(settings.SHARED_DRIVE_CONF.transfer_dir, filename)
    else:
        _, fpath = tempfile.mkstemp()
    return fpath