NodeJS Sppull库:下载文件返回sharepoint文件的空数组

bvk5enib  于 2023-04-20  发布在  Node.js
关注(0)|答案(1)|浏览(110)

验证码:

const context = {
    siteUrl: 'https://<tenant>.sharepoint.com',
  creds: {
    username: "<username>@<tenant>.onmicrosoft.com",
    password: "***",
    online: true
  }
};

const options2 = {
    spRootFolder: "Shared%20Documents/docverify",
    dlRootFolder: "./docverify"
  };

SPPull.download(context, options2)
  .then((downloadResults) => {
    console.log("Files are downloaded", downloadResults);
    console.log("For more, please check the results", JSON.stringify(downloadResults));
  })
  .catch((err) => {
    console.log("Core error has happened", err);
  });

输出:

Files are downloaded []
For more please check the results []

SharePoint enter image description here中文件的附加屏幕截图
要下载的文件

t2a7ltrp

t2a7ltrp1#

请将“%20”更改为“\”
密码:

spRootFolder: "Shared%20Documents/docverify"

我的代码:

spRootFolder: "Shared\ Documents/docverify"

它对我有作用。

相关问题