def METHOD_NAME(self, result_id, path, create=True):
    path = os.path.normpath(path.lstrip('/'))
    if path.startswith('../'):
        raise ValueError('Upload path not allowed: %s' % path)
    result_base_dir = os.path.join(self.base_dir, 'results',
            (result_id[:-3] or '0') + '+', result_id, '')
    result_base_url = '%sresults/%s+/%s/' % (self.base_url,
            result_id[:-3] or '0', result_id)
    return LogFile(os.path.join(result_base_dir, path),
            lambda: self.hub.recipes.tasks.register_result_file(result_base_url,
                result_id, os.path.dirname(path), os.path.basename(path),
                result_base_dir),
            create=create)