1

I have sharepoint documents library and I have wcf service from where i should download new version of document file on button click.

So i got next method:

   public void UpdateFile(SPListItem item, Stream newFileStream)
    {
       // How to update file?
    }

And i want to change existing sp item file to new one from stream.

How to do this?

1 Answer 1

2

as per my knowledge you have to upload a template document with content type and metadata mapping.

so u can update the document. because document is generated based on your template.

below couple of links which helps you..

http://somnathmatere.blogspot.in/2011/05/how-to-programmatically-upload-document.html

http://www.sharepointbleached.com/2012/04/upload-document-programmatically.html

http://whitepages.unlimitedviz.com/2011/02/using-document-templates-with-lists-and-content-types-in-sharepoint/

http://www.bfcnetworks.com/pull-sharepoint-2010-document-properties-into-word-quick-parts/

1
  • Those examples of adding new files. I want to leave existing SPListItem and just change or update file.
    – Ievgen
    Jan 16, 2013 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.