How to access a directory at the same level as the "current workflow data area" data directory on the Knime portal

Knime version 5.2.5

Hello all,

I cannot read files from a directory located in the workflow directory from the Knime portal.

Directory absolute path example: /home/<user_name>/workspace_knime/<workflow_name>/<input_directory/

The only way I made it work on my local Knime client is by using the “Local file system” option of the “String to Path” node but then the workflow cannot be loaded on the portal server saying “ERROR List Files/Folders 27:734: Execute failed: Direct access to the local file system is not allowed on KNIME Server.“.

My question/need:

Does anybody know a way to access such directory to be used afterwards by string manipulations and Path type variables?

Without using “Local file system” option of the “String to Path” because it prevents the workflow to be loaded on the Knime portal.

Thanks, Christian

Hello @raspoutine31
The standard way that path calls a file within KNIME Hub is: ‘Read from’ [ Relative to ] [ Current workflow ]

These types of path variables can be manipulated in string format with Path to String (Variable) and String to Path (Variable) nodes.

BR

1 Like

Hello gonhaddock,

I understand for “data” directory but what about a directory under the workflow directory?

Directory absolute path example: /home/<user_name>/workspace_knime/<workflow_name>/<input_directory/

Such a directory is copie when deployed to a server with a Knime portal.

Thus, the use of “Local File System” Path type makes the workflow impossible to deploy to a server and relative paths must be used.

Thanks

First, I didn’t welcome you to the KNIME Community in my previous post . Feel at home.

I haven’t tested it in Hub but, I assume you can configure the nodes as [ Relative to ] [ Current workflow data area ] …

The procedure for editing Path variables is the same, however the format would be just the hanging folder name converted to Path using [ Relative to ] [ Current workflow data area ] conversion, within the ‘String to Path (Variable)’ node

An example:
Let’s assume that your data is in the following folder (RELATIVE): knime://knime.workflow/data/PDF_files
Your string format path is “PDF_Files" It will be transformed to relative by using the right settings within the ‘String to Path (Variable)’ node

BR

1 Like

Ok but what about if the directory is under “knime://knime.workflow/” and not in “knime://knime.workflow/data”?

“knime://knime.workflow/PDF_files” and not “knime://knime.workflow/data/PDF_files”

For now, I’m using Knime v5.2.5 and not a Hub version.

@raspoutine31
I don’t think you can access system folders under knime://knime.workflow from the self system. ‘data’ folder is a gate to work with your own data for supporting .knwf sharing function.

Then you can structure working files under ‘data’ folder. Other ways you would manipulate node’s system folders…

1 Like