Upload a File to Sharepoint Using C#
- Remove From My Forums
How to upload files from c# asp.cyberspace to SharePoint Online library
All replies
Subscribe to:
Post Comments (Atom)
How to upload files from c# asp.cyberspace to SharePoint Online library
Hullo guys,
What is the better way about upload files from c# asp.net awarding to SharePoint Online library?
thank you
Hi,
Nosotros can utilize CSOM C# to accomplish it. The following example code for your reference.
static void Master(cord[] args) { cord SiteUrl = "https://tenant.sharepoint.com/sites/squad"; string DocumentLibrary = "Documents"; string FileName = @"C:\temp\test.pdf"; string CustomerFolder = "Subfolder"; string UserName = "admin@tenant.onmicrosoft.com"; string Password = "xxx"; UploadFileToSharePoint(SiteUrl, DocumentLibrary, CustomerFolder, FileName, UserName, Password); } private static void UploadFileToSharePoint(cord SiteUrl, cord DocLibrary, string ClientSubFolder, string FileName, cord Login, cord Password) { try { #region ConnectToSharePoint var securePassword = new SecureString(); foreach (char c in Password) { securePassword.AppendChar(c); } var onlineCredentials = new SharePointOnlineCredentials(Login, securePassword);
0 Response to "Upload a File to Sharepoint Using C#"
Post a Comment