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
Hi,
You can create Custom rule with Execute script and write your logic to to check extension and if it match then throw error.
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
@akash251998 are you able to find the solution to restrict uploading .exe? I am also going through similar requirement.
The add-on should work, try adding following property in alfresco-global.properties file:
mimetypes.restricted.expression=application/x-dosexec|application/octet-stream|application/x-sh
To block the content uploads, first create a folder and apply the aspect named "Mime Type Restrictable" on the folder.
All content uploads with .exe extension (application/x-dosexec) should get blocked.
In case if it doesn't work, try the enhanced version available here: https://github.com/abhinavmishra14/alfresco-mimetype-blocker/blob/sdk4.1.0/README.md
I have converted the project to make it work for ACS6.x as well.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.