Tuesday, April 15, 2008

Managing Blocked File Types in SharePoint 2007

Not Allowed

The other day I was trying to upload a file with a particularly hostile file extension into a SharePoint document library. When uploading it through Windows Explorer I would get an error like:

Cannot copy [FileName.Ext]: The parameter is incorrect.

When I tried to upload the same file through the browser UI I got a slightly better error:

The following file(s) have been blocked by the adminitrator: [Path/FileName.Ext].

Allowed

SharePoint manages a list of file types per web application that are not allowed to be uploaded or downloaded. It also affects their behavior on server. For example if you were unpacking a .ZIP in a document library files that had blocked extensions would not be unzipped. A possible solution is to remove this file extension as a blocked type. To do this:

  1. Open up the SharePoint Central Administration web site.
  2. Under Operations click on Blocked File Types under the Security Configuration section.Managing blocked file types in SharePoint central administration.
  3. Select the Web Application that you want to allow/block the file type for and add/remove the extension from the list.Add/Remove your blocked file type from the web application list.
  4. Click OK. When you revisit your document library you should be able to upload those types of files.

That's it. Hope that helps someone.

Best,
Tyler

5 comments:

Flores Online said...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Flores Online, I hope you enjoy. The address is http://flores-on-line.blogspot.com. A hug.

Anonymous said...

This is great stuff.

But, do you happen to know how to modify the blocked file types on the WOPR?

Ryan said...

Hi,
Is it possible to customize the 'blocked file type' error page in Sharepoint? We currently have an internet facing MOSS 2007 website which gives a very 'Sharepoint-ish' error page saying 'The following file(s) have been blocked by the administrator: /sites/sitename/test.asp '. I'd like to make that error page at least look like the rest of the site. Is there any way to do this?

Regards,
Ryan

Tyler Holmes said...

There's a couple ways to swing at this.

1) Customize the layouts page in the 12 hive. I wouldn't really recommend this as you could get overwritten in a microsoft update AND it will affect ALL sharepoint sites in the farm.

2) Write a List Receiver that detects certain file attachments and then compares those against ones allowed. You can then stop the adding of the item and forward the user to a page of your choosing.

Hope that helps,
Tyler

Rodrigo Dorta said...

Thanks for this my friend! My problem is solved now :)