What I'm trying to do is upload a file with metadata without creating a new version using the client object model.

I already have this code:

  byte[] bytes = System.IO.File.ReadAllBytes(@"D:\inor.pdf");

  using (ClientContext context = new ClientContext(Properties.Settings.Default.SiteURL))
    FileCreationInformation newFile = new FileCreationInformation()
      Content = bytes,
      Url = string.Format("inor9.pdf", DateTime.Now.Ticks)

    List certificateList = context.Web.Lists.GetByTitle("Certificaten");

    Microsoft.SharePoint.Client.File uploadFile = certificateList.RootFolder.Files.Add(newFile);

    uploadFile.ListItemAllFields.ParseAndSetFieldValue("CertificateNumber", "356");


But the problem with this code is that 2 versions are created version 0.1 and 0.2. I don't want 2 versions because i have an itemreceiver on the itemadded that needs this certificatenumber. ItemAdded is now fired before the certificatenumber is added.


It seems not to be possible to update item from client model without changing version, but you can use ItemUpdated instead of ItemAdded and check the version of file to be equal 0.2 or 2.0 depending on list version settings.

In server model there is a very useful method - SystemUpdate that updates without changing version, modified data and person who modified but client model seems to miss this functionaloty.

  • Pretty disappointing that there isn't something like systemupdate in the client model. I think i'm going to upload my files with a webservice. I already have the webservice, so i guess that will be the easiest way :) – Marlou Nov 3 '11 at 13:45
  • Having a SystemUpdate method in the client model would be a pretty big security hole. – Paul Lucas Jan 2 '12 at 22:09

what you could do is make the version property of you doc lib to false, while you are uploading. and turn it back on when you are done ?

  • In think that in that case my itemadded evenreceiver will still be fired before the metadata is added :( – Marlou Nov 3 '11 at 13:41

I've used the webservices that I've already created. In this webservice I use the server model and I'm able to use the systemupdate method

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.