I have this client OM code to add a new file in a doc.lib.:
clientContext.ExecuteQueryAsync(
(o, args) =>
{
var fileCreationInformation = new FileCreationInformation();
fileCreationInformation.Content = System.Text.Encoding.Unicode.GetBytes(reportContent);
fileCreationInformation.Overwrite = true;
var uploadLocation = string.Format("{0}/{1}", reports.RootFolder.ServerRelativeUrl, title + STR_Extension);
fileCreationInformation.Url = uploadLocation;
Microsoft.SharePoint.Client.File newFile = reports.RootFolder.Files.Add(fileCreationInformation);
ListItem newItem = newFile.ListItemAllFields;
clientContext.Load(newItem);
clientContext.Load(newFile);
clientContext.ExecuteQueryAsync(
(o1, args1) =>
{
...
When context client have Full control permissions or Design permissions is working perfect. But I get Exception when user have only Contribute permissions to doc.lib. Of course I can create a new report or upload a new report using the browser, but the code is not working in this case.
Any clue ?
Thank you