Generate HTML page

Hi to all,

I’m trying to write on my FTP but I have an error.

I want to generate .html + image pages and save them on my FTP.

   {
  "name": "CustomImage",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "path": "person",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        400,
        300
      ],
      "webhookId": "c5282386-ef74-4ddb-aa4b-bca7f3b0ca00"
    },
    {
      "parameters": {
        "operation": "text",
        "text": "=This is n8n  {{$node[\"Webhook\"].json[\"query\"][\"lastname\"]}}",
        "fontSize": 100,
        "positionX": 300,
        "positionY": 500,
        "options": {}
      },
      "name": "Edit Image",
      "type": "n8n-nodes-base.editImage",
      "position": [
        1360,
        130
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "https://docs.n8n.io/assets/img/final-workflow.f380b957.png",
        "responseFormat": "file",
        "options": {}
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1180,
        160
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "return item.query;\n"
      },
      "name": "FunctionItem",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        570,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://uclic.fr/tool/template.html",
        "responseFormat": "string",
        "options": {}
      },
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        790,
        270
      ]
    },
    {
      "parameters": {
        "functionCode": "item.data = item.data.replace(/{{subject}}/g, $node[\"Webhook\"].data.query.subject);\nitem.data = item.data.replace(/{{redirection}}/g, $node[\"Webhook\"].data.query.redirection);\n\nreturn item;\n"
      },
      "name": "FunctionItem1",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        980,
        270
      ]
    },
    {
      "parameters": {
        "operation": "upload",
        "path": "/"
      },
      "name": "FTP",
      "type": "n8n-nodes-base.ftp",
      "typeVersion": 1,
      "position": [
        1620,
        180
      ],
      "credentials": {
        "ftp": "FTP"
      }
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Edit Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "FunctionItem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FunctionItem": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "FunctionItem1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FunctionItem1": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Image": {
      "main": [
        [
          {
            "node": "FTP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "id": "1"
}

Thanks

Welcome to the community @delcros_w!

Looks like the “Path” is wrong. It expects the full path of the file create. Your current one / is not valid, it would rather have to be something like /test.html

Actually, in your case you have to make sure that the HTML and the image end up in different “items” (as you are currently overwriting one with the other. One way do do that is using the Merge-Node and selecting append) and you would then set the “Path” to an expression which uses, for example, the existing name of the file (if you would hardcode that it would overwrite each other and also have the wrong file extension).

Ok thanks for the answer, however this explains the FTP error?
Thanks Jan !

{
  "name": "CustomImage",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "path": "person",
        "options": {}
      },
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1,
      "position": [
        400,
        300
      ],
      "webhookId": "c5282386-ef74-4ddb-aa4b-bca7f3b0ca00"
    },
    {
      "parameters": {
        "operation": "text",
        "text": "=This is n8n  {{$node[\"Webhook\"].json[\"query\"][\"lastname\"]}}",
        "fontSize": 100,
        "positionX": 300,
        "positionY": 500,
        "options": {}
      },
      "name": "Edit Image",
      "type": "n8n-nodes-base.editImage",
      "position": [
        1090,
        370
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "url": "https://docs.n8n.io/assets/img/final-workflow.f380b957.png",
        "responseFormat": "file",
        "options": {}
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        790,
        480
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "functionCode": "return item.query;\n"
      },
      "name": "FunctionItem",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        570,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://uclic.fr/tool/template.html",
        "responseFormat": "string",
        "options": {}
      },
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        790,
        270
      ]
    },
    {
      "parameters": {
        "functionCode": "item.data = item.data.replace(/{{subject}}/g, $node[\"Webhook\"].data.query.subject);\nitem.data = item.data.replace(/{{redirection}}/g, $node[\"Webhook\"].data.query.redirection);\n\nreturn item;\n"
      },
      "name": "FunctionItem1",
      "type": "n8n-nodes-base.functionItem",
      "typeVersion": 1,
      "position": [
        960,
        100
      ]
    },
    {
      "parameters": {
        "operation": "upload",
        "path": "/"
      },
      "name": "FTP",
      "type": "n8n-nodes-base.ftp",
      "typeVersion": 1,
      "position": [
        1590,
        230
      ],
      "credentials": {
        "ftp": "FTP"
      }
    },
    {
      "parameters": {},
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "typeVersion": 1,
      "position": [
        1280,
        230
      ]
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Edit Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "FunctionItem",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FunctionItem": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          },
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "FunctionItem1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FunctionItem1": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Image": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "FTP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "id": "1"
}

I guess. The node works fine for me when I supply a valid path in the latest version. So I would assume that this strange FTP error disappears once that is the case. If not simply get back to me.

I have update N8N, always the same problem

@delcros_w were you able to figure this out?