Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Handling Document Library Events

  Asked By: Kevin    Date: Jan 06    Category: Sharepoint    Views: 922

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?



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Handling Document Library Events Or get search suggestion and latest updates.