I am getting SharePoint Error: The server does not allow messages larger than 2097152 bytes error while uploading large file.
Can you please help me Below is my code:
Folder currentRunFolder = site.GetFolderByServerRelativeUrl(barRootFolderRelativeUrl + "/" + newFolderName);
FileCreationInformation newFile = new FileCreationInformation { Content = System.IO.File.ReadAllBytes(@p), Url = Path.GetFileName(@p), Overwrite = true };
currentRunFolder.Files.Add(newFile);
currentRunFolder.Update();
context.ExecuteQuery();