How to upload a file as a new version to a document library using the object model

a guest Feb 22nd, 2012 15 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //byte array holding the contents of the file
  2. byte[] contents = File.ReadAllBytes(path);
  3. file.CheckOut();
  4.                 file.SaveBinary(contents);
  5.                 file.CheckIn("New version");
RAW Paste Data