Add Blocked File Types in SharePoint 2010

string webAppUrl = "Your URL";               
string myBlockFileType = "dll";                   
Uri myUri = new Uri(webAppUrl);                   
SPWebApplication myWebApp = SPWebApplication.Lookup(myUri);                   
Collection<string> blockFileTypes = myWebApp.BlockedFileExtensions;                   
blockFileTypes.Add(myBlockFileType);                   
myWebApp.Update();

Hope this will helps you...
Happy Coding....
 

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell