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[] fileData) { using (Stream ms = new MemoryStream(fileData)) { File.SaveBinaryDirect(context, relativeItemUrl, ms, true); } } […]
↧