cancel
Showing results for 
Search instead for 
Did you mean: 

Rule Wizard for block file

samjeff
Champ in-the-making
Champ in-the-making
Dear all,

I would like to create a rule from Rule Wizard to block file, all extension except PDF file.
So, when users try to copy *.exe, *.tif, *.jpg, etc, it can't be copied, because only *.pdf allowed.
Would you please to guide me?

In Rule Wizard, I found Execute Script, do I must use this to apply above rule?
Would you please to tell me the script?

Thank you so much for your help

Best regards,

samjeff
3 REPLIES 3

samjeff
Champ in-the-making
Champ in-the-making
Dear all,

I've already found it.
I make a Javascript, the filename is pdfonly.js then upload on Data Dictionary > Scripts

The script here:


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


It is successfully to block any extension files, except PDF one.
😄

samjeff
Champ in-the-making
Champ in-the-making

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


When I tried it to CIFS Server, it is no problem.
But when tried to Web Client, it shows error:
org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/2d9bcdce-532a-11dd-a0b0-5f148afd947f

Do you have any ideas to solve this?

ajaywazir
Champ in-the-making
Champ in-the-making
Hi
We have experience same problem
document.remove();
throws the mentioned exception

Ajay