Unable to retrieve binary data from LINE Webhook image in n8n

Describe the problem/error/question

Hi everyone,

I’m trying to use n8n with the LINE Messaging API.
When a user sends an image, the Webhook is triggered correctly, but I cannot retrieve the image as binary data.

I was able to receive the request via Webhook, but when I try to get the binary data in a Code node, I only get "filesystem-v2".

What I actually want is to access the real content and then convert it to base64.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Code in JavaScript

//Get the binary data
const binaryData = items[0].binary.data.data;

// Convert to a Base64 string using Buffer
const base64 = Buffer.from(binaryData, 'binary').toString('base64');

// For debugging purposes (only the first 100 characters are displayed)
console.log("Base64 preview:", base64.substring(0, 100));

// Return as JSON
return [
  {
    json: {
      base64Image: base64,
      test : binaryData.substring(0,150)
    }
  }
];


Result
base64Image:ZmlsZXN5c3RlbS12Mg==
test:filesystem-v2

The expected behavior is to get the actual binary data content with items[0].binary.data.data;.
However, what I get instead is just "filesystem-v2".

Information on your n8n setup

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

Hey could you also pin the data in the HTTP request so I can test it out?

1 Like

Hi there @hiro , welcome to the community

In n8n, we have a built in node to convert binary data to base64, you can try it, this is how it would be in your workflow

this way, you do not need the code node

hope tht helps, and if it does, please mark my answer as the solution and give it a like thank you!

2 Likes

Thank you everyone〜!

I solved it.
I was able to easily convert it by using the extract from file node.

Thank you!

I solved it.

I was able to easily convert it by using the extract from file node.

Thanks so mush〜!!

then can you mark my answer as the solution please, as it would greatly help me, thank you!

2 Likes

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