Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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/

share|improve this answer
    
Those examples of adding new files. I want to leave existing SPListItem and just change or update file. –  Evgeny Jan 16 '13 at 12:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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