将文件上传到子文件夹产生错误 "Value does not fall within the expected range"

Uploading file to Subfolder produces error "Value does not fall within the expected range"

我在尝试将文件上传到库中的共享点子文件夹时遇到上述错误。我很确定 url 是正确的,因为如果我对它进行任何其他更改,它会给出 "File not found error"。

    public void UploadFile(string client, IEnumerable<FileUpload> documents)
    {
        foreach (var document in documents)
        {
            using (var context = new ClientContext(sharePointSite))
            {
                var listCollection = context.Web.Lists;

                var list = context.Web.Lists.GetByTitle(client); //clientname

                context.ExecuteQuery();

                var fileCreationInformation = new FileCreationInformation()
                {
                    Content = document.FileBytes,
                    Url = @"https://sharepointsite.com/sites/client/docStore/clientname/cdae2d570ab24b02811a8bce88ebea64/new1.zip",
                    Overwrite = true
                };

                var file = list.RootFolder.Files.Add(fileCreationInformation);

                context.ExecuteQuery();
            }
        }
    }

我从上面的代码中删除了一些内容以使其更易于阅读(文件夹 createion/netwrok 凭据)。谁能看到我哪里出错了?还有更好的方法吗?我见过的所有上传到子文件夹的解决方案都是提供文件 URL。有没有一种方法可以明确上传到代码中的文件夹?

URL错了。

应该是/sites/client/docStore/clientname/cdae2d570ab24b02811a8bce88ebea64/new1.zip