Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. FileCreationInformation newFile = new FileCreationInformation();
  2. newFile.Content = System.IO.File.ReadAllBytes(file.FileName);
  3. newFile.Url = Path.GetFileName(file.FileName);
  4.  
  5. List docs = clientContext.Web.Lists.GetByTitle("List_Name");
  6. Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
  7. clientContext.Load(uploadFile);
  8. clientContext.ExecuteQuery();
  9.  
  10. FileCreationInformation newFile = new FileCreationInformation();
  11. newFile.Content = System.IO.File.ReadAllBytes(UserCV.FileName);
  12. newFile.Url = Path.GetFileName(UserCV.FileName);
  13.  
  14. List docs = clientContext.Web.Lists.GetByTitle("List_Name");
  15. Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
  16. clientContext.Load(uploadFile);
  17. clientContext.ExecuteQuery();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement