I’m trying to upload a binary file (pdf) to harvest.
Since the provided interface does not support this (yet?), I’m using ‘HTTP-Request’.
I’ve captured the binary file (a pdf) from an incoming email (IMAP).
What is the error message (if any)?
I receive the error message: “The item has no binary field ‘[object Object]’ [item 0]”
As shown in the screenshot, the node input has a binary called “attachment_0”.
In the field ‘Input Data Field Name’ I’ve tried an expression shown in the screenshot. In the screenshot, it is visible that the expression does result in the binary object.
I’ve also tried the fixed value “attachment_0” which also gives me an error message.
At point 1 in the screenshot below, I also read the content of the binary file. Here I’m using “attachment_0” and this works.
I’ve duplicated that node and moved it to points 2 and 3.
The duplicated node at point 2 works.
The duplicated node at point 3 gives me the same error message.
By the looks of it, it seems like the merge node is causing the issue. Although in the debugger, the binary is visible as output from the node “Merge1”.
In the variant with “attachment_1” it said item 1 is missing the binary, that suggests that it worked for item 0 and item 1 simply has no binary . (I missed that earlier)
You need to do a different merge. Append appends the item that has no binary.
each item has a json part and a binary part.
th issue is, that for the second item the node expects a binary object named “attachment_0” but the binary object is empty or undefined.
a neat trick to see the results for different items, is to switch the input view to table.
when you mouse-over the different rows it will show the results for each item.
instead of the aggregate node you could have changed the merge node to:
“combine” → merge by position (or merge by field if theres a correlation)
“choose branch” → select the input with the binary
be aware, that if the Workflow has multiple items as input it will fail in production, the way you set it up now, because it will only work for the first item.