Updating file stream via Object Model creates versions and updates metadata

Article ID: 2833705 - View products that this article applies to.
Expand all | Collapse all

Summary

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.

More information

This behavior is By Design.
  1. SharePoint OM does not expose a public API to edit the content stream of a file and force not creating a new version.
  2. 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.
  3. The design of a number of SharePoint features depend on never changing historical document versions.
  4. 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.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2833705 - Last Review: April 23, 2013 - Revision: 3.0
Applies to
  • Microsoft SharePoint Server 2013
  • Microsoft SharePoint Server 2010
Keywords: 
KB2833705

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com