Consider the scenario where you have a SharePoint site having a document library with versioning enabled on it. In such a case, when you use the SharePoint Object Model (OM) to update the file stream of a document stored in the document library, you notice that an additional version of the file gets created. Moreover, the metadata/user properties (e.g. ModifiedBy, LastTimeModified) of such a file gets changed. Additionally, you notice that you are not allowed to update the historical/previous versions of the document.
This behavior is By Design.
- SharePoint OM does not expose a public API to edit the content stream of a file and force not creating a new version.
- SharePoint OM does not expose a public API that allows to update the stream of a current version of a file in a way that does not change the metadata/user properties.
- The design of a number of SharePoint features depend on never changing historical document versions.
- For virus cleaning scenarios, we recommend that you use the VSAPI to update the clean document streams (for current versions) into SharePoint. Historical versions which are reported as infected are marked internally as such and are not accessible anymore.
Article ID: 2833705 - Last Review: Apr 23, 2013 - Revision: 1
Microsoft SharePoint Server 2013, Microsoft SharePoint Server 2010