Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

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

By: a guest on Feb 22nd, 2012  |  syntax: None  |  size: 0.19 KB  |  views: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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");