I wrote an event sink for a document library. I have all the code
working but one piece: If a field in the library is set to `Approved –
Final' I need to move the event file from that library to another
Document Library which is located in a sub-web of the parent web.
I understand that the `moveto' method will not work for files outside
the same site. Would I use the `add' method of the SPFileCollection ?
Here is the snippet of code I am trying to get to work but it keeps
error-ing with the Event Log message of "There is no file with that
URL in this web"
SPWeb site = new SPSite( <DestinationLibraryURL> ).OpenWeb();
byte[] binFile = <fileObjectToMove>.OpenBinary();
site.Files.Add(<DestinationLibraryURL>, binFile,true);
Do you know someone who can help? Share a link to this thread on twitter, or facebook.