Hi,
whenever i try to use this code
var myFile = new FileCreationInformation(); myFile.ContentStream = doc.ContentStream; using (ClientContext ctx = TokenHelper.GetClientContextWithAccessToken((string)request.Properties[hW], (string)request.Properties[aT])) { Folder destionationFolder = ctx.Web.GetFolderByServerRelativeUrl(destinationPath); ctx.Load(destionationFolder); ctx.ExecuteQuery(); File uploadedFile = destionationFolder.Files.Add(myFile); ctx.Load(uploadedFile); ctx.ExecuteQuery(); }
I get the following error message:
"Specified argument was out of the range of valid values.\r\nParameter name: bytesToCopy"
Maybe there is another way to upload a file which is bigger than 2MB using the CSOM in combination with OAuth (SharePoint 2013/Office365?
best regards
Joerg