Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Handling Document Library Events

  Asked By: Kevin Lewis         Date: Jan 06, 2003      Category: Sharepoint      Views: 224
 

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.

Tagged:        

 

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.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].