Problems renaming using SFTP node and variable file names

Trying to rename (and put) files on an SFTP server.
This works if the names are hardcoded into the node, but when trying to use variables to drive source and destination names in a prior function, "Error: No such file" is raised. using node-red-contrib-sftp

Any ideas on how to pass the src/dest as variables?

[
    {
        "id": "9621641beda81abd",
        "type": "debug",
        "z": "7c0ebce243632905",
        "name": "debug 5",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 900,
        "y": 860,
        "wires": []
    },
    {
        "id": "e0714f71d3e36c17",
        "type": "SFTP-main",
        "z": "7c0ebce243632905",
        "path": "/",
        "method": "rename",
        "remoteFilePath": "",
        "localFilePath": "/",
        "remoteDestPath": "",
        "useCompression": "",
        "encoding": "utf8",
        "mode": "",
        "recursive": "false",
        "server": "5aa1834ab03a65fd",
        "x": 590,
        "y": 840,
        "wires": [
            [
                "9621641beda81abd"
            ]
        ]
    },
    {
        "id": "24702feb8b9877d2",
        "type": "inject",
        "z": "7c0ebce243632905",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 220,
        "y": 840,
        "wires": [
            [
                "96b663a84c8f0d61"
            ]
        ]
    },
    {
        "id": "96b663a84c8f0d61",
        "type": "function",
        "z": "7c0ebce243632905",
        "name": "function 8",
        "func": "\n\nmsg.remoteSourcePath ='/u/awards/spool/NEWELL_BRANDS/out/pending/is08459888.txt';\nmsg.remoteDestPath ='/u/awards/spool/NEWELL_BRANDS/out/pending/__is08459888.txt';\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 400,
        "y": 840,
        "wires": [
            [
                "e0714f71d3e36c17"
            ]
        ]
    },
    {
        "id": "82c6c81e484422fd",
        "type": "SFTP-main",
        "z": "7c0ebce243632905",
        "path": "/",
        "method": "rename",
        "remoteFilePath": "/u/awards/spool/NEWELL_BRANDS/out/pending/is08459888.txt",
        "localFilePath": "/",
        "remoteDestPath": "/u/awards/spool/NEWELL_BRANDS/out/pending/__is08459888.txt",
        "useCompression": "",
        "encoding": "utf8",
        "mode": "",
        "recursive": "false",
        "server": "5aa1834ab03a65fd",
        "x": 590,
        "y": 920,
        "wires": [
            [
                "9621641beda81abd"
            ]
        ]
    },
    {
        "id": "8ac06aa0844fa856",
        "type": "inject",
        "z": "7c0ebce243632905",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 220,
        "y": 920,
        "wires": [
            [
                "82c6c81e484422fd"
            ]
        ]
    },
    {
        "id": "5aa1834ab03a65fd",
        "type": "SFTP-credentials",
        "host": "10.233.238.142",
        "port": "22",
        "username": "sistema",
        "password": "dexion2020"
    }
]

Yup might want to try a different node. If you follow the link you provided, and then follow the View in GitHub link for the node, you will see it hasn’t been updated in over 5 years and there are two issues that are still open. My guess is the author has abandoned the node but you could open an issue and see if you get a reply.

I have had significant problems with FTP nodes in the past. Now I use an exec node to run command line ftp commands to do what I want.

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