Sending file in a POST service?

Hi there,

I’m using a service task with the connector extension to send process variables to my IoT platform using POST HTTP request. In my process a text file is added as a process variable through a user form.

How can I send this file (as a binary or as part of form data) as a POST request?

My plan B is to store the contents of the file as a string variable and send this but there must be some kind of way around this i guess

Tim

You get the bytes of the file variable and covert to base 64. Then send the base 64 string in your http payload

Here is a example of using groovy to prep the file: Attachment and ECM enterprise contents management

But you can do similar with JS. Search base64 in the forum and look for code snippets

1 Like