Blocked File Types in SharePoint 2013

Getting “Error: Sorry, something went wrong. The following file(s) has been blocked by the administrator.” in SharePoint 2013? Well, This is due to Blocked File Types configuration in SharePoint 2013!

blocked file types in sharepoint 2013

What is Blocked File Types in SharePoint 2013?

Blocked file types is a security mechanism in SharePoint to restrict files based on its extension. Obviously, You want to protect your environment from potential threats via Malicious scripts and executables. Or as part of your governance policies, You don’t want your users to upload MP3 files to SharePoint, isn’t it? So, blocked file types restrict specific file types from uploading to SharePoint. Users cannot upload these blocked file types to SharePoint list (as an attachment!) or a library.

Please note, SharePoint checks for blocked files ONLY based on file’s extension but not actual file type. In other words, You can rename a blocked file (say: EXE file to Doc) to something else to allow SharePoint to upload the file.

Tips: In short, Blocked File types defines File types that are not allowed in SharePoint!

How to Manage Blocked File Types in SharePoint 2013?

Blocked files management is done from SharePoint 2013 Central Administration site. To manage blocked files, Navigate to Central Administration >> Security >> Define Blocked File Types.
unblocking blocked file types in sharepoint
Blocked files list is configured per web application basis. You can get the list via the “Manage Web Applications” page as well.

sharepoint blocked file types powershell

Default blocked File Types:
By default, There are 105 blocked file types in SharePoint 2013. To allow or restrict file types, you can edit this list. Just enter one Extension per line.

  • To restrict a file type, simply add that file type extension to this list
  • To remove restriction on a particular file type, Locate and remove that extension from this list.
manage blocked file types sharepoint

Here is the List of default blocked files in SharePoint 2013:

sade
adp
asa
ashx
asmx
asp
bas
bat
cdx
cer
chm
class
cmd
cnt
com
config
cpl
crt
csh
der
dll
exe
fxp
gadget
grp
hlp
hpj
hta
htr
htw
ida
idc
idq
ins
isp
its
jse
json
ksh
lnk
mad
maf
mag
mam
maq
mar
mas
mat
mau
mav
maw
mcf
mda
mdb
mde
mdt
mdw
mdz
msc
msh
msh1
msh1xml
msh2
msh2xml
mshxml
msi
ms-one-stub
msp
mst
ops
pcd
pif
pl
prf
prg
printer
ps1
ps1xml
ps2
ps2xml
psc1
psc2
pst
reg
rem
scf
scr
sct
shb
shs
shtm
shtml
soap
stm
svc
url
vb
vbe
vbs
vsix
ws
wsc
wsf
wsh
xamlx

Add/Remove SharePoint blocked file types with PowerShell:

Here is an example in PowerShell script to get/add/remove blocked file types in SharePoint 2013.

Write-host "Enter the Web Application URL:"
$WebAppURL= Read-Host
$WebApplication = Get-SPWebApplication $webAppURL
$Extensions = $WebApplication.BlockedFileExtensions
    
write-host "Blocked File Types:"
$Extensions | ForEach-Object {Write-Host $_}
 
#To Add a Blocked File type
$Extensions.Add("dlg")
$WebApplication.Update()
write-host "DLG File type has been Blocked"
 
#To Remove a Blocked File type
$Extensions.Remove("dlg")
$WebApplication.Update()
write-host "Blocked File type DLG has been Removed"

How about Files which are already uploaded?
Blocked file type settings are applicable not only to new files
which you are going to upload but also to existing files. So, if a blocked file type is already uploaded, you can’t edit or view the file. Only delete operation is permitted.

How to restrict a specific file type in SharePoint document library?
What if you want to restrict the document library to allow only PDF files? Well, You have to develop a Event Receiver which fires and checks during “ItemAdding” event. Here is my post: Restrict File Types in SharePoint Document Library Upload using Event Receiver

Here is my another article that includes managing blocked files using PowerShell:  Manage Blocked File Types in SharePoint 2010 . Technet Reference: Manage blocked file types in SharePoint 2013

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *