I implement one handler to catch document library events.. . I copy the code from msdn help named “Handling Document Library events”
Its working, but following is my problem
“ when I am uploading any document to document library automatically the document must be move to another place ( for eg to this location http://computer-name/DocumentStore “ ) For that I wrote the following code
1. if ((listEvent.Type == SPListEventType.Insert))
2. {
3. SPWeb site = listEvent.Site.OpenWeb();
4. SPFile file = site.GetFile(listEvent.UrlAfter);
5. file.moveto(“someURL”+file.Name,True);
6. }
I am getting the filename and other file properties but the file is not moving to specified location..
I use try catch block to catch any errors but…….. No error ……
I tried somany ways ……………..
Can anyone please help me in this?
Do you know someone who can help? Share a link to this thread on twitter, or facebook.