Category Archives: SharePoint

Sending large data with CSOM

As a follow up to my recent post showing how to create or overwrite a document using the CSOM, I’m now going to show how to upload a file containing large amounts of data. To see the original post, click … Continue reading

Posted in CSOM, SharePoint | Tagged , | 8 Comments

Large Data and REST Services

When working with web services within SharePoint you sometimes need to be able to post and get large amounts of data through it. Instead of adding binding information to the web.config file(s), always a pain with SharePoint on deployment, depending … Continue reading

Posted in SharePoint | Tagged , , | Leave a comment

Set Title Field on Document Upload

When uploading a file to a SharePoint library through code, you sometimes want to set item properties at the same time the document is created. To achieve this you simply populate a Hashtable object and pass this into the Add … Continue reading

Posted in SharePoint | Tagged | 3 Comments

Run With Elevated Privilges

SharePoint Short #20 Instead of explicitly wrapping code in a RunWithElevatedPrivileges block, it’s better to first check if the user has sufficient privileges and only elevate when they don’t. Instead of: SPSecurity.RunWithElevatedPrivileges(() => { // elevated code… });SPSecurity.RunWithElevatedPrivileges(() => { … Continue reading

Posted in SharePoint, SharePoint Shorts | Tagged | Leave a comment

Cannot invoke HTTP DAV request

When using the Client-Side Object Model (CSOM) for SharePoint and you’re trying to create\overwrite a file using binary data, you’d naturally try and use the SaveBinaryDirect method of the File class: public void SaveFile(Microsoft.SharePoint.Client.ClientContext context, Microsoft.SharePoint.Client.File file, string relativeItemUrl, byte[] … Continue reading

Posted in CSOM, SharePoint | Tagged , | 2 Comments