2

I want to upload documents from a ASP MVC website to my Sharepoint document library. Found a lot of websites about this topic, but most of them are focussed on uploading documents from within Sharepoint.

I found this article about uploading documents with REST, but in the source code there are references to:

_spPageContextInfo.webAbsoluteUrl

Am I missing some libraries or is there another way to upload documents from outside Sharepoint?

  • Do you want to upload from server-side ASP MVC, or from client-side? From server side, could be easier. – Evariste Jan 26 '16 at 14:16
  • @Everiste Server side ASP MVC is okay. – Citizen SP Jan 26 '16 at 14:33
1

To upload a file to SharePoint from C# code, the best is to use the client-side C# API of SharePoint. This only requires to add two DLLs as references to your Web app project (Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll).

Examples of usage to upload files:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.