Tag Info

Hot answers tagged

6

SharePoint has great built in methods to copy or move documents across sub-sites or lists within the same site collection. You can use SPFile.MoveTo or SPFile.CopyTo. You can even move whole folders and their contents with the SPFolder.MoveTo method. Very nice. Unfortunately, these do not work across site collections. where as use of RootFolder.Files.Add ...


1

ItemUpdating allows you to get the file before the upload/action has taken place. ItemUpdated requires you to go through version history. In code you can get the previous version as follows: SPFile file = ...; SPFileVersion previousVersion = file.Versions[file.Versions.Count - 1];



Only top voted, non community-wiki answers of a minimum length are eligible