0

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#

1

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.

1
  • 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 '14 at 16:07
1

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

2
  • 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 '14 at 8:55
  • @Steven, you solution is working great. Now, how can I fill in items while I am uploading a document? Nov 17 '14 at 14:56

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.