Upload files from FileSystem to SharePoint online using CSOM

Here is the code to upload files from your local FileSystem to SharePoint online using Client Side Object Model.

Download Source Code

The program reads all the folders and files from the specified folder and uploads to SharePoint Online. It also creates the folders and sub folders in the document library on the fly.


  • Update the source folder path in the app.config
  • Update the SiteUrl and TargetLibrary in the app.config

Happy coding!!

Comments (0)

Skip to main content