How to send Binary File (.jpg) from Read Binary Files to HTTP Request nodes as body param

Describe the problem/error/question

How to send Binary File (.jpg) from Read Binary Files to HTTP Request nodes as body param

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

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:

I’ve never worked with that API, but if their api wants JSON and not a binary blob, you will need to use the move binary data node to convert the binary file to json so you can upload it. This is the node:

1 Like

My input Files : .jpg

This looks like your file doesn’t contain valid JSON, so the error message would seem to be spot on here. To upload binary data you’d need to specify the correct binary property after selecting the suitable content type:

Make sure to use the latest version of n8n and a new HTTP Request when doing so, as older versions do not allow mixing binary and non-binary content (and you didn’t specify which version you currently use).

Example workflow showing the idea:

Request arriving on the server side:

Hope this helps!

1 Like

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