Convert KNIME protocol path to absolute path

I am on KNIME v4.2.x. I cannot upgrade to v4.3.

I am trying to copy/move a file out of a KNIME temporary directory into a local directory on my PC. The Copy/Move Files node does not support the KNIME protocol, so I can’t reference the file using the relative path.

Is there any way to convert a KNIME Protocol relative path into an absolute path on my machine?

i.e. How can I convert:
knime://knime.workflow/tmp/knime_tc_b41jearztl5u/filename.xlsx

to

C:\Users\Username\KNIME_DEPLOYMENT\workspace\Workflow_Name\tmp\knime_tc_b41jearztl5u\filename.xlsx?

Alternatively, is there another way to move files using a relative path?

Thanks,
Andrew

2 Likes

You can list the temporary location where the data from your knime workflows are saved.

This is the version before the new file paths

2 Likes

We have an in-house node which resolve knime:// urls. I will see if it can get it released (I dont anticipate that being a big problem.)

Steve

3 Likes

As a workaround, I’ve always used this construct to convert from knime:// to absolute paths (you don’t even need the last “String to URI” node):

image

5 Likes

Hello @AndrewDevlin,

I assume you used Create Temp Dir node? If you uncheck option Create temp directory in workflow folder you’ll get absolute path to your file (if that doesn’t lead to any unwanted behavior as mention in node description). And once you will be able to update to version 4.3. Transfer Files node is able to handle relative paths.

Br,
Ivan

2 Likes

Thanks everyone for the suggestions…what a great community we have here!

Unchecking the “Create temp directory in workflow folder” option in the Create Temp Dir node resolves the issue for me.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.