Help ! from base64 to file

Hi all,
i got a base64 image that i need to write on disk

i can correctly get in a webhook the base64 data

the data is correct

But i don’t understand how to use move binary data to get a binary .

Is this the right way ?
I certainly don’t understand something,

thanks for help

You do not need to use the Move Binary Data node. You need a function node to map the base64 image to a binary structure in n8n and then reference the binary key in the Write Binary File node. Check the example below. Btw you might need to do a split in the incoming string to remove the data:image/jpeg,base64.

Instead of sending the image to the webhook as base64, it should be much simple to send the image as binary when making the HTTP request to the Webhook. That way, n8n would do the transformation for you, meaning the Function node does have to be used.

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "logo",
              "value": "iVBORw0KGgoAAAANSUhEUgAABQAAAALQCAYAAADPfd1WAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAOxAAADsQBlSsOGwAAFIZJREFUeJzt2EENwCAAwMAxk7jBJ2qYioWkuVPQd8fa8zwAAAAAQNJ7OwAAAAAA+I8BCAAAAABhBiAAAAAAhBmAAAAAABBmAAIAAABAmAEIAAAAAGEGIAAAAACEGYAAAAAAEGYAAgAAAECYAQgAAAAAYQYgAAAAAIQZgAAAAAAQZgACAAAAQJgBCAAAAABhBiAAAAAAhBmAAAAAABBmAAIAAABAmAEIAAAAAGEGIAAAAACEGYAAAAAAEGYAAgAAAECYAQgAAAAAYQYgAAAAAIQZgAAAAAAQZgACAAAAQJgBCAAAAABhBiAAAAAAhBmAAAAAABBmAAIAAABAmAEIAAAAAGEGIAAAAACEGYAAAAAAEGYAAgAAAECYAQgAAAAAYQYgAAAAAIQZgAAAAAAQZgACAAAAQJgBCAAAAABhBiAAAAAAhBmAAAAAABBmAAIAAABAmAEIAAAAAGEGIAAAAACEGYAAAAAAEGYAAgAAAECYAQgAAAAAYQYgAAAAAIQZgAAAAAAQZgACAAAAQJgBCAAAAABhBiAAAAAAhBmAAAAAABBmAAIAAABAmAEIA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},
        "options": {}
      },
      "name": "Set",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        520,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {},\n    binary: {\n        data: {\n\t\t\t\tdata: items[0].json.logo,\n\t\t\t\tmimeType: 'image/png', // Optional but should be set if possible (optional)\n\t\t\t\tfileExtension: 'png', // Optional but should be set if possible (optional)\n\t\t\t\tfileName: 'logo.png', // Optional but should be set if possible (optional)\n\t\t\t}    }\n  }\n]"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        770,
        300
      ]
    },
    {
      "parameters": {
        "fileName": "image.png"
      },
      "name": "Write Binary File",
      "type": "n8n-nodes-base.writeBinaryFile",
      "typeVersion": 1,
      "position": [
        990,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set": {
      "main": [
        [
          {
            "node": "Function",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function": {
      "main": [
        [
          {
            "node": "Write Binary File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

hi @RicardoE105,
i understand that is a turnaround, i can send the raw format but when when binary data is set on, i got no response from the webhook.
I will open a new post
thanks