Page 1 of 1

Blocking Mime types folder wise

PostPosted:Thu Oct 26, 2023 12:34 pm
by shihab
Hi,

I have a query, I am trying to customize openkm. My aim is to block mime types by folder wise. For example a folder named "folder1" should allow only .docx files and folder "folder2" allow only .pdf files, is there any solution to achieve this scenario.

Re: Blocking Mime types folder wise

PostPosted:Sat Nov 18, 2023 8:23 am
by jllort
You must create an Rule with and automation action in PRE at the event CREATE_DOCUMENT -> when uploading the document in PRE ( stage where the document still is not created ) can check the document name and if the extension is not allowed raise an exception.

I share a link to create your action plugin https://docs.openkm.com/kcenter/view/ok ... ction.html

Re: Blocking Mime types folder wise

PostPosted:Mon Nov 20, 2023 6:41 am
by shihab
Dear Jllort,

Thanks for the reply,

I gone through the link It is working fine( put the jar file in Tomcat x.y /plugin folder and restart the openkm service)

In my case I think to create a new table AS "OKM_BLOCKED_MIMETYPES" (screen shot attached) with two columns 'document_path' and 'document_type'. When user upload a document compare the path and mimetype with my table values , found any match through exception.

1. document_path -> will capture the path of the directory
2. document_type -> the blocked mime types in to the folder.

Is there any way to debug the code in development server,

In the screen shot I tried with an example of simple folder creation on our development server as a simple java project.

Getting error as shown in the screen shot while create an object of OKMFolder class.

Re: Blocking Mime types folder wise

PostPosted:Mon Nov 20, 2023 10:10 am
by jllort

Re: Blocking Mime types folder wise

PostPosted:Tue Nov 21, 2023 8:58 am
by shihab
Hi ,

This below mentioned link is not working, is there any video link available for linux.

Tomcat developing: How do I configure Tomcat to support remote debugging?

Re: Blocking Mime types folder wise

PostPosted:Fri Dec 29, 2023 7:29 pm
by jllort
The previous link worked for me, but you can try this one https://docs.openkm.com/kcenter/view/ok ... -tips.html ( it contains the section what describes how to do remote debug )

Also can search in Google "tube eclipse tomcat remote debug" sure will find something