Our client is running CRM and SharePoint and they would like to upload attachments from CRM into SharePoint 2013 Online. I started searching the web for some help and I came to this Microsoft page. It gives an example how to upload files via REST Api and jQuery. However, I would like to know if that is possible to do it using c#? Our client insists that it should be c# code. Can anyone guide me to some examples?

If I have to use the REST Api, can someone show me how to use it with C#

2 Answers 2


You should explain the new app development model in SharePoint 2013. Since your environment is SharePoint online it doesn't support any kind of server side deployment.

You can easily use JavaScript object model along with REST API to achieve this. And this approach doesn't require any deployments.

If you still want to use C# then start looking into creating an APP along with CSOM .Net library.

  • The solution does not have to be deployed to SharePoint. Just to give an example, they would like to test it first from a console application or an asp.net page. They need c# code because they don't know CSOM and SharePoint. Nov 13, 2014 at 16:07

The following link shows you how to upload a file to SharePoint Online using REST or CSOM using C#. Hope this helps.

Uploading to SharePoint Online

  • I have seen your blog. Thanks for the link though. One question, besides attachments can I send metadata to fill in fields in the library using REST? sorry I am new to sharepoint and rest. Nov 17, 2014 at 8:55
  • @Steven, you solution is working great. Now, how can I fill in items while I am uploading a document? Nov 17, 2014 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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