How to convert image (uploaded to the n8n form trigger as file) to binary form

Hey guys, I am new to n8n and I need help with processing the image data that was uploaded to the n8n form trigger as a file type data. The image is a png image file.


Now, I need to upload that image in the form of binary data/octet stream (as required by the url endpoint) to a url endpoint using the http request node. How can I do this? I have been struggling for a whole morning without any clues at the end.

Appreciate for any helpful answers from yall.

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Welcome to the community @Yin !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.

Make sure that you have removed any sensitive information from your workflow and include dummy or pinned data with it!


I don’t think you need to do anything to the binary file you already have. Just add that file to the body.

Note that you binary is saved in the variable called “Media_Attachments”. Hence that is the name to use as the value of Input Data Field Name field

Just tried that, but not working. An error came out: This operation expects the node’s input data to contain a binary file ‘Media_Attachments’, but none was found [item 0]. I attach a screenshot below for your reference. I also tried to view the png image and it is showing fine. Not sure what is the issue here.

**edit: Just now I switched to using google drive node to download the image, set it as “data”, and upload it to the url endpoint. It worked well! I think the problem is caused by the n8n form trigger node. I am just gonna refrain from using it for now. Thanks for you help btw :smiley:

1 Like

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