File variable set through external Task is serialized as Bytes

I have an external task that is downloading a PDF File and setting it as a variable inside a process. The code I’m using is the following:

FileValue variableValue = Variables.fileValue(filename).file(byteContent).mimeType(mimeType).create();
  Variables.createVariables().putValue("pdf", variableValue);

Instead of using a File type variable, camunda cockpit shows it as Bytes and download’s it as a file without a format.

Hi @fenix-hub
What do you set as mimeType?

Regards,
Alex

Hi, mime type was application/pdf.
Anyway we found the issue: the task definition inside the map had the output variable set to “String or expression”, so the File variable was re-mapped at the end of the task.

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