'How to Download a Folder with subfolder with all file inside the folder from SharePoint Online using c#?
I try to dowload all folder structure from sharepoint online, I try some code here Thanks for your help:
public void DownloadFilesAndFolders(ClientContext _ctx, Folder folder, string localFolder)
{
Console.WriteLine(folder);
Console.WriteLine(localFolder);
_ctx.Load(folder, k => k.Files, k => k.Folders);
_ctx.ExecuteQuery();
foreach (var folders in folder.Folders)
{
string folderPath = string.Format(@"{0}\{1}", localFolder, folder.Name);
Console.WriteLine(folder.Name);
System.IO.Directory.CreateDirectory(folderPath);
DownloadFilesAndFolders(_ctx, folder, folderPath);
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
