SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Document Library and ItemAdding Event

               In one of our project, we are supposed to lock down the users from creating folders at ROOT in document library. We thought of restricting through event handler. During coding we found that, ItemAdding event doesn't provide enough information to determine where the folder is been added.

              Searching on net, we found that was the bug in MOSS, and Microsoft has provided a hotfix. You can get the Hotfix information in the below URL. It not only solves this problem, but also couple of other bugs, which you can find it in this URL.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;934790

             After installing this hotfix, you will get the AfterUrl property is having the information to determine where the folder/file is been added. But be careful in installing this hotfix, bcose sometimes it might negatively affect your project. We faced a problem of 'Access denied' error message for accessing LOGS folder programmatically. So, testing the hotfix completely in a test environment is mandtory b4 installing on Development/Production machines.

 Satheesh Palaniswamy. 

 


Posted 10-15-2007 6:51 PM by Satheesh

Comments

Links (10/16/2007) « Steve Pietrek’s SharePoint Stuff wrote Links (10/16/2007) « Steve Pietrek’s SharePoint Stuff
on 10-16-2007 8:08 PM

Pingback from  Links (10/16/2007) « Steve Pietrek’s SharePoint Stuff

gbelzile wrote re: Document Library and ItemAdding Event
on 02-20-2008 8:44 AM

Hi, I'm trying to do the same thing but I only want to prevent from creating folders, not files.  I didn't find enough information in the properties to differenciate between the two because the SPListItem is null at this point.  How did you do it?

Satheesh wrote re: Document Library and ItemAdding Event
on 03-11-2008 6:49 AM

sorry for the delayed reply, you have content type property to determine, that is folder or a file.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.