pass file in a POST call

Hi All,

There has been some discussion in past about the possibility to send file via a POST call. I’m refereeing to a thread in the forum here (How to pass a file with node POST (using with a RESTful API))

Has there been any update in this regards? or someone manage to find a workaround?

I could use a python script to send the file via POST call, however the problem is that Restfull service I’m working with requires token based authentication and python script node doesn’t support credentials variable. It is essential for me to use credential node as the workflow will be used by others and they might not supposed to see the Token as raw string.

Best,

Bilal

Hello @nizamibilal1064,

There is an existing ticket (AP-6694) and this topic will be updated as soon as the ticket is closed.

5 Likes

hi @nizamibilal1064 I know its been a few months but I wonder if my “experimental” component can be of assistance, which can build a “multipart message” that can include a file attachment and posted using the POST node.

The component is here

and there is a demo workflow which posts a json file to the postman echo api here:

4 Likes

Hey @takbb and @nizamibilal1064 ,

Thank you for sharing your approach — really nice work! Funny enough, we were working on the same problem at the same time. :slightly_smiling_face:

You can find a shared component and workflow example below:

The main difference is that we tried to avoid script nodes entirely, and we added the option to explicitly define the object type for the multipart call. I wanted to share this here as well to gather early feedback.

This isn’t just my work but the result of a more collective effort, and I turned it into a reusable component so others can try it out.

That’s why I thought it belonged here on the Forum, too.

Looking ahead, our goal is to improve the component further — in particular, to reduce execution time and remove the costly binary → base64 → bytes → base64 → binary conversions.

Happy to hear any thoughts or ideas from you and the community!:tada:

5 Likes

Thanks @takbb . Seems quite useful to me. I will try to use your component.

Thanks @diego_rod_lop , I definitely will give it a try.

Do you know if there is a plan to include this feature in the standard POST call node?