I am using SPPull but it downloads all the files in the folder I want to download specific files in a list
async function downloadFromSharePoint(path, projFolder, url, FilesToDownload) {
var fileOpts = {
spRootFolder: "path + projFolder,
dlRootFolder: "./downloads",
};
var context = {
siteUrl: url,
creds: {
clientId: config.SHAREPOINT_CLIENTID,
clientSecret: config.SHAREPOINT_CLIENTSECRET
}
};
SPPull.download(context, fileOpts)
.then(() => {
console.log("Files are downloaded");
})
.catch((err) => {
console.log("Core error has happened", err);
});
}
I tried to add shouldDownloadFile in fileOpts and give it the list but all the files in the folder downloaded Anyone can help?