Is there a way to "bundle" binary files

Describe the problem/error/question

I have an out put of two binary files. that I would like to send together in a via a form-data http request, Is there a node that can bundle these together as one data file and keep the file in one data field?

Information on your n8n setup

  • **n8n version:0.225.2
  • Running n8n via (n8n cloud):
  • Operating system:

Hey @Philip_Wiggins,

There may a couple of cloud services that allow you to merge the PDF documents but that could cause confusion, You could try compressing them and uploading a zip file or depending on what the form expects you could try sending both it looks like the HTTP Request node allows sending multiple binary objects.

You may need to merge the binary items into one item though to make it a bit easier.

1 Like

I want the files to stay separate, keep their current file names, but in my http request, I want to be able to just call the one input data field instead of having to call the http request once for each binary data file, if possible. So instead of two items out put both file are under the same item.

Sounds like you would want the second approach then and merge the binary items and add 2 binary fields to the http request node.

Example workflow for that can be found here: Merge binary objects on multiple items into a single item | n8n workflow template

1 Like

Awesome this is exactly what I was looking for. Thanks for the help. My google foo failed me today.

Quick follow up when I make my http call after merge. how do I get both data files?

Add 2 binary data options and use data_0 for the first one and data_1 for the second.

I may not have 2 documents everytime, sometimes I might have 3 documents

Any ideas on what to try if there are multiple? Or do will I need to do a count and do a switch with different inputs for http request?

Hey @Philip_Wiggins,

I missed this one this morning, You would need to do a count and rather than a switch node maybe use a filter node which will do the same thing but you won’t be limited to just 4 options so you can add as many filters as you need.

This isn’t pretty but at the moment it is the best I can think of.


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