koltyakov / sppull

📎 Download files from SharePoint document libraries using Node.js without hassles
MIT License
46 stars 16 forks source link

Sppull library: download files returning empty array for sharepoint files #65

Closed Asthay97 closed 1 year ago

Asthay97 commented 1 year ago

Code: ``` const context = { siteUrl: 'https://.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); });


Output: ```
Files are downloaded []
For more please check the results []

Screenshot of sharepoint image WhatsApp Image 2022-11-25 at 11 49 34 AM

koltyakov commented 1 year ago

Hey @Asthay97,

You have a wrong path in configuration object:

"Shared%20Documents/docverify"

while it's just "Shared Documents" library with no folders:

image
Asthay97 commented 1 year ago

Hi @koltyakov, Thanks a lot for helping out. The code worked after fixing the path.

koltyakov commented 1 year ago

Great to hear it worked. Thanks for the feedback!