SharePoint 2016-CSOM-File Upload-via-ClientContext

February 27, 2018

Exception:
An unhandled exception of type 'System.Net.WebException' occurred in Microsoft.SharePoint.Client.dll Additional information: The remote server returned an error: (409) Conflict.

Code:
var clientContext = new ClientContext("http://myservername/sites/subsitename") { Credentials = LogonCredentials };
using (var fileStream = new FileStream(@"C:\Temp\Test.txt", FileMode.Open))
{
Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, "/MyDocLibraryName/Test_FromClientOM.txt", fileStream, true);
}

Reason :
• Context can be from Root site or from Sub site, does not make difference.
• Verify that Second parameter to .SaveBinaryDirect( method is right.
• API does not create a folder
• Note: Second parameter is path starting from Root Site, Not Sub site.
So ideally code should be like:
Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, “/sites/subsitename /MyDocLibraryName/MyFolderName/Test_FromClientOM.txt”, fileStream, true);

Enjoy SharePoint.

Advertisements

Free remote SharePoint online – Office 365 training – Part 3

January 21, 2018

Free remote SharePoint online – Office 365 training (3 sessions)
Participate in our free remote SharePoint online – Office 365 training.
First session 11/15/2017 – 6:00-8:00 PM Eastern time
The second session 11/22/2017 at 6:00 PM US Eastern time.
The third session 11/29/2017 at 6:00 PM US Eastern time.
Join the meeting:
https://join.me/aasoftech

Below are the link for the presentation-Recording:
(Third session)
https://recordings.join.me/KhYLlgbRTUSlAL8pIRA4Jg
https://recordings.join.me/NWD9_20C00a1ob_r3FTzcw

Download Third presentation from here.


Office 365 – Remote SharePoint online training course-Part-2-Overview

December 25, 2017

Free remote SharePoint online – Office 365 training (3 sessions)
Participate in our free remote SharePoint online – Office 365 training.
First session 11/15/2017 – 6:00-8:00 PM Eastern time
The second session will be on 11/22/2017 at 6:00 PM US Eastern time.
The third session will be on 11/29/2017 at 6:00 PM US Eastern time.
Join the meeting:
https://join.me/aasoftech

Below are the link for the presentation-Recording:
(Second session)
https://recordings.join.me/hRPCX2O96EWYszAcEEm46Q

Download second presentation from here.


Office 365 – Remote SharePoint online training course-Part-1-Overview

November 26, 2017

Free remote SharePoint online – Office 365 training (3 sessions)
Participate in our free remote SharePoint online – Office 365 training.
First session 11/15/2017 – 6:00-8:00 PM Eastern time
The second session will be on 11/22/2017 at 6:00 PM US Eastern time.
The third session will be on 11/29/2017 at 6:00 PM US Eastern time.
Join the meeting:
https://join.me/aasoftech

Below are the link for the presentation-Recording:
(First session)
https://recordings.join.me/DI6cXr6uI0iGhONep6DvlA

https://recordings.join.me/cGYfnzLPkEW3XJwCAPLlTA

Download presentation from here.


CSR-JSLink for SharePoint / Office 365

September 24, 2017

Topic: CSR-JSLink for SharePoint / Office 365
Audience: Executive
SCOPE: Brief

Click here to see CSR/JSLink presentation


SharePoint 2016, new features

February 18, 2017

Topic: SharePoint 2016, new features
Audience: SharePoint Consultant
SCOPE: Basic

Click here to download presentation


SharePoint Branding Strategy

January 27, 2017

Topic: SharePoint Branding Strategy
Audience: SharePoint Consultant
SCOPE: Cross Referenced

Click here to download presentation