cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent uploading of certain file types?

natebsi
Champ in-the-making
Champ in-the-making
Is it possible to prevent users from uploading files with a certain extension?
4 REPLIES 4

seraphon
Champ in-the-making
Champ in-the-making
use space rules for that.
You have conditions that can detect files extension. As for the action I m not sure you can delete, but you can move the files with the forbidden extension to a "trashcan".

Regards
Seraphon

lakshmi
Champ in-the-making
Champ in-the-making
Hi even am looking at disabling upload capability for certain files….
Can you tell me if there is a action that will move content to trashcan….cos under action i cannot see such an option while configuring rules.
I tried to write my own action by using
this.nodeService.moveNode(actionedUponNodeRef, getArchiveRootRef(),  ContentModel.TYPE_FOLDER, assocRef.getQName());

I get java.lang.NullPointerException
        at org.alfresco.repo.node.db.DbNodeServiceImpl.setChildUniqueName(DbNodeServiceImpl.java:2037)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.moveNode(DbNodeServiceImpl.java:445)

someone has any idea how to move a node to trashcan .

lakshmi
Champ in-the-making
Champ in-the-making
Hi I tried to move a node to Archive store…..by seeting the moveActiontoArchive as rule for content uploaded with specific mime type.
On uploading a content with the specified mimetype the rule action initiates, i try to move the node by

this.nodeService.moveNode(actionedUponNodeRef, getArchiveRootRef(),ContentModel.ASSOC_CHILDREN , QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "move"));

but i get

org.alfresco.service.cmr.repository.InvalidNodeRefException: Node does not exist: workspace://SpacesStore/73343938-1c26-11dd-b015-57bc895f54c2

I suppose the node is not created when the rule starts to execute…or what is the reason for this exception?

How to solve this?

Pls help out….


Thanks,
Lakshmi

lakshmi
Champ in-the-making
Champ in-the-making
Ok i managed to move node to Archive store….by selecting run in backgorund check box for the rule.
When i upload content and click OK the content node moves to archive space and when it returns to browse.jsp there is a message that is thrown::

Unable to find the repository item referenced by Id: d6cf8d47-1c3a-11dd-a78d-ff16be4206e4 - the record has probably been deleted from the database.
This is thrown as the node has been moved to archive node .Ok.

But i did like to throw my own custom message. How to throw custom error message from action class configured via rules?