I am trying to download a file from SharePoint (and in a later method also upload a file to SharePoint) using a client ID and secret on a C# WinForms app. Struggling to find information on how to actually download a file or upload a file from or to a specific folder or path on SharePoint. If possible Id also like to have a progress bar to show download progress.
I am currently using async web client download elsewhere in the application from other websites, but our SharePoint server requires using secret key and client ID to connect.
string siteUrl = "https://company.sharepoint.com/sites/MediaHost";
string clientId = "clientIDhere";
string clientSecret = "secretIDhere";
using (var clientContext = new OfficeDevPnP.Core.AuthenticationManager().GetAppOnlyAuthenticatedContext(siteUrl, clientId, clientSecret))
{
}