cancel
Showing results for 
Search instead for 
Did you mean: 

How to block uploading .exe files in alfresco?

shibu
Champ in-the-making
Champ in-the-making
I have installed alfresco.4.2.c in my windows machine.
I don't want allow ".exe" files to be uploaded.
So, please let me know the solution to block .exe files in alfresco?
5 REPLIES 5

shibu
Champ in-the-making
Champ in-the-making
One way which I found is;
Creating a Rule, by importing the following script on condition "Items are created or enter this folder".

if(document.mimetype == "application/octet-stream")
{
  document.remove();
}
else
{
   document.save();
}

Its working properly.
<strong>Here I would like to give an alert message to the user.</strong>
Updated my script by adding "
alert('EXE files cannot be uploaded');
" in the if section. But it gave an error message when I tried to upload exes. ERROR :- 13 bytes (Failure: Failed to execute script 'workspace://SpacesStore/bed935) .
So please let me know the way to give an alert here.

mrogers
Star Contributor
Star Contributor
You can't alert the user from a rule.   The rule is running on the server,  not the user's web browser.  

shibu
Champ in-the-making
Champ in-the-making
The script
if(document.mimetype == "application/octet-stream")
{
  document.remove();
}
else
{
   document.save();
}


is removing folders also.
How can I solve this?
Or Is there any way to check with file extensions?

zladuric
Champ on-the-rise
Champ on-the-rise
Maybe you can attach to the upload script on the client side and listen to a failed upload, and if you find one, alert the message.

shibu
Champ in-the-making
Champ in-the-making
Do I have any other ways to block uploading .exe,.msi in Alfresco? Because, The rule which I have created above will keep the files in Trashcan. I dont want to keep it in Trashcan too.
The requirement is .exe,.msi  files should not be uploaded. Better block uploading and show alert message or allow uploading and delete from both the folder and trashcan at the same time.
Please help me…