1
vote
1answer
104 views

How to Copy SPFile to another library while retaining history

I am looking for code that will 100% duplicate a file including all historical versions, dates of versions, comments and anything else. My test code is showing that capturing all those details is a ...
3
votes
1answer
782 views

SPFile.CopyTo() vs RootFolder.Files.Add()

I've been looking for method of copying a file or folder from one document library to a number of other libraries with the same name in each subsite for a particular site collection. What needs to ...
0
votes
1answer
113 views

Every SPFile is null in a document library using PowerShell?

What the crap is this about? I whipped up a fairly simple run-once and discard PowerShell script to iterate through all of the files in a list and make a simple change. The problem is every SPFile I ...
0
votes
1answer
117 views

Retrieve previous file contents on ItemUpdated

I am writing an event receiver on a document library. I need to get the previous version of the document, before the upload. BeforeProperties unfortunately does not give me the SPFile, only the ...
1
vote
1answer
3k views

Get all documents from a sharepoint document library

I want to retrieve all the existing documents from an SPDocumentLibrary in order to print them so I've tried this way but then I got stucked : using (SPSite mysite = SPContext.Current.Site) { ...
0
votes
2answers
433 views

Differentiate in ItemUpdated (ER) if file was edited or overwritted

I've an ItemUpdated Event Receiver, and I need to make different operations depending if the file was updated throw UI or overwritted. Is there any internal field that reflects this 2 different ...
1
vote
3answers
4k views

Getting specific SPFile from document library

I have a Document Library called "x" with file named "y". I am curious what the best way to get the SPFile object for the specified SPListItem. Currently I am using this: ...
2
votes
0answers
45 views

Error thrown after SaveBinary in ItemAdded event handler

I'm working on a ItemAdded event for a document library, and I'm running into this error in SharePoint 2007... The file Lists/Shared Audit Documents/1387/Audit Report.docm has been modified by ...
0
votes
1answer
800 views

Looking for a way to replace the File in an SPListItem

I have implemented a system for publishing documents from a document library to a Document Centre. This uses a Send To Connection set up with the "Move and leave a link" option. When this is used the ...
3
votes
3answers
2k views

Copying file from network to Document Library

I'm trying to save file from network location to SharePoint document library. This is code of my method: //parameters: string documentLibraryUrl, string filePath FileInfo fi = new ...
0
votes
1answer
286 views

Copying a document between libraries breaks QuickParts

I am copying a file between 2 libraries which contain the same fields. So basically the source library serves as a template library. After the file is copied i update the field values in the ...