Losing variable type when sending files across pools/processes


I’m trying to send a file across pools, but the engine seems to forget the file type.
The upload is modeled after the invoice example and works perfectly fine. When going into the camunda cockpit and clicking on the process instance I can see and download the file by clicking on the corresponding variable. The type of the variable is “File”.
The file then gets send to another pool/process along with two other variables, which also works, at least almost. The variables arrive at the second process but when checking the process instance in the cockpit the type changed to “Bytes” instead of “File”. And when I download the file, it has no file ending like “.pdf”. When I add that manually, I am able to open it in Adobe Reader.
But the missing variable type causes another problem. In the process, to which the file gets sent, I have a user form, that lets the user download said file. But the download button is not shown. I also completely modeled that after the invoice example. What is weird is that I can’t even download the file without the ending. I can’t download it at all in this user form.

Long story short: How can I pass the file/variable type when sending a file across pools using message flows?

If you would like to have any additional information, please let me know.
Thank you!

Best Regards

This is an example for a Message throw event to pass a File to a process started by a message:
${execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation("message_test").processInstanceBusinessKey("desiredBusinessKeyFroNewProcessInstance").setVariable("variable1ofprimitiveType",variable1ofprimitiveType).setVariable("variable2ofTypeFile", execution.getVariableTyped("variable2ofTypeFile")).correlateWithResult()}