Problem uploading multiple photos to Chat node

Hello, everyone!

Describe the problem/error/question

I am sending PHP curl to n8n to the ‘When chat message received’ node with the following values:

array(6) {
[“sessionId”]=>
string(36) “0b42ab4c-5bfa-4a10-936a-7fffd7853dec”
[“action”]=>
string(11) “sendMessage”
[“chatInput”]=>
string(4) “ii22”
[“data0”]=>
object(CURLFile)#1 (3) {
[“name”]=>
string(27) “/tmp/phpt033eavak6j93LrRAUC”
[“mime”]=>
string(10) “image/jpeg”
[“postname”]=>
string(21) “cristiano-ronaldo.jpg”
}
[“data1”]=>
object(CURLFile)#2 (3) {
[“name”]=>
string(27) “/tmp/phph1m5e3ggkb968xxYdHO”
[“mime”]=>
string(9) “image/png”
[“postname”]=>
string(8) “rys2.png”
}
[“files”]=>
string(276) “[{“fileName”:“cristiano-ronaldo.jpg”,“fileSize”:“80.2 kB”,“fileExtension”:“jpg”,“fileType”:“image”,“mimeType”:“image/jpeg”,“binaryKey”:“data0”},{“fileName”:“rys2.png”,“fileSize”:“304.3 kB”,“fileExtension”:“png”,“fileType”:“image\/png”,“binaryKey”:“data1”}]”
}

In the chat node in n8n, in the output in the json tab, I see this:

But in the Binary tab, I see this:

What is the error message (if any)?

N8n only sees one attached photo instead of two

Please share your workflow

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

n8n Probably mounted both files under the same binary object. Considering that the JSON output mentions both files, they may be present. Try a Loop node, with a flow that processes binary data, and see if the loop executes twice.

You can also add an Edit(Set) Fields node right after this one and use expressions to refer to binary data(latest n8n versions only). Paste in this expression: {{ $input.item.binary }} and see what value it holds.

{{ $input.item.binary }} contains only one element :frowning:

I’m not familiar with PHP, so I couldn’t see the issue in your request. However, if it would be any of help this is a HTTP request node that I tested with the Chat Trigger and worked(received both binary files). If you can write its equivalent in PHP it should work.

Hey, this problem only occurred with the chat node. I just managed to fix it. I did it differently this time. I simply send the files as base64 and n8n converts them to binary files.

1 Like