1

Is it possible to overwrite file in document libraries with versioning enabled?

I am unable to find any information about this.

  • Question is not clear. Is it about OOB interface or custom code? – Alok Kumar Gupta Mar 28 '17 at 10:21
  • @AlokKumarGupta custom c# code using Microsoft.SharePoint2013.CSOM ver 15 – Andrii Horda Mar 28 '17 at 10:30
  • What is an "overwrite" in this i.e. what do you think will happen - all previous versions of file will be removed or the currently uploaded file will become latest version? – Alok Kumar Gupta Mar 28 '17 at 10:32
  • @AlokKumarGupta currently uploaded file will have same version number which was the latest before upload, overwriting file behind it – Andrii Horda Mar 28 '17 at 10:52
2

To overwrite file version you should use SystemUpdate method. For a long time is was available only in Server Side Object Model.

According to Office Dev blog post it is now available in CSOM also but only in SharePoint Online/Office 365 environment, as mentioned in this post.

Here is CSOM SystemUpdate method description in MSDN.

| improve this answer | |

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.