Restrict .exe files to upload

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Established Member

Restrict .exe files to upload

As my requirement is to restrict .exe files to upload as these .exe files can harm the dms. I have used the addon from the link:

https://github.com/keensoft/alfresco-mimetype-blocker but it is not working for me.

So is there any other way to do this restriction.

 

Regards

Akash D

2 Replies
Highlighted
Senior Member II

Re: Restrict .exe files to upload

Hi,

You can create Custom rule with Execute script and write your logic to to check extension and if it match then throw error.

Thanks & Regard,
Sanjay
Highlighted
Established Member

Re: Restrict .exe files to upload

I have created a custom rule like :

function main()
{
  var name = document.name;
  var siteName = document.siteShortName;
  var parent = document.parent;
  

  if (ext === 'pdf' || ext === 'zip' || ext === 'doc' || ext === 'exe')
     throw "Unsupported file format.are not supported at this time. File name:  " + name + ", Site Name: "  + siteName;

}

main();

And it is perfectly working for pdf,zip,doc but not for exe. What is incorrect in my logic. If there is any other login please tell me.
Regards
Akash