yukyo
December 27, 2023, 11:05pm
1
Describe the problem/error/question
I want to send an HTTP Request to an endpoint that requires multiple files to be sent (This endpoint is going to merge all the files into one).
What is the error message (if any)?
The problem is the Parameter Type “n8n Binary Data” only allows to write one binary data field name.
Example, if I send the request like this, it works:
But if I try to send multiple files in the fileInput field then it fails. It’s because the n8n Binary Data type expects only one file…
If you add more than one it literally tries to send it with that name:
“data_0, data_1, data_2” as one file and because that file doesn’t exist then errors:
Any ideas?
Information on your n8n setup
n8n version: 1.20.0
Database (default: SQLite): Postgresql
n8n EXECUTIONS_PROCESS setting (default: own, main): queue
Running n8n via (Docker, npm, n8n cloud, desktop app): docker-image
Operating system: linux gcs
Jon
January 16, 2024, 2:25pm
2
Hey @yukyo ,
The best I can think of for that would be to use a code node but I did find a similar question to this and there is an answer below which may help
Hi @Nick_K_H , does your service accept these files in individual requests? If so, you can split our files into individual n8n items with one file each:
If your service requires all files in a single request in separate fields I am afraid you’d have to create multiple routes in your workflow that handle the different possible options. You could use a Filter node here checking if {{ Object.keys($binary).length }} equals 2, if so connect an HTTP Request node processing attachment_0 and attachmen…
strayr
March 9, 2024, 2:18pm
3
This definitely works, I can upload all the mails.
I would like to get the name of the sender, say “Facebook” into the name of the file.
Let’s say the invoice name is “invoice123456”, I would like to change it to [year][month][date]-invoice123456-Facebook
Jon
March 11, 2024, 11:45am
4
Hey @strayr ,
On the upload I think we have an option to set the filename, Have you tried using that?
system
Closed
June 9, 2024, 11:45am
5
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.