HELP, I don't know what variable to send to node md5-file

I use this node

msg.filepath = ``; with directory but don't work

No such file or directory

[
    {
        "id": "9e0822ba05e4d42d",
        "type": "md5.file",
        "z": "b733adccca0e0554",
        "name": "trigger.txt",
        "filepath": "",
        "hashField": "md5",
        "x": 520,
        "y": 1340,
        "wires": [
            [
                "759c389c2304de12"
            ]
        ]
    },
    {
        "id": "759c389c2304de12",
        "type": "debug",
        "z": "b733adccca0e0554",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 740,
        "y": 1340,
        "wires": []
    },
    {
        "id": "5d055539f864b3e5",
        "type": "inject",
        "z": "b733adccca0e0554",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "str",
        "x": 230,
        "y": 1340,
        "wires": [
            [
                "653615c339614e35"
            ]
        ]
    },
    {
        "id": "653615c339614e35",
        "type": "function",
        "z": "b733adccca0e0554",
        "name": "",
        "func": "msg.filepath = 'C:\\\\Users\\\\dumitru.maros\\\\.node-red\\\\doc\\\\trigger.txt'\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 380,
        "y": 1340,
        "wires": [
            [
                "9e0822ba05e4d42d"
            ]
        ]
    }
]

I guess the obvious thing would be to double-check that the file really is in that position :slight_smile:

THen I would change the \s to / which Windows is absolutely fine with and avoids all the double \\ malarky.

And I would test without the c: on the front in case the md5 node hasn't been well coded and can't cope with the Windows drive letter on the front.

1 Like

I think the node md5-file don't read the variable msg.filepath, because i try in linux and same

I found solution
simple import module md5

msg.payload = md5(msg.payload); :smiley: :smiley:

[
    {
        "id": "8c4804ebaf1b3b5c",
        "type": "inject",
        "z": "b733adccca0e0554",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 140,
        "y": 1520,
        "wires": [
            [
                "4cfe8d356f0407f5"
            ]
        ]
    },
    {
        "id": "e1f1324de713b421",
        "type": "function",
        "z": "b733adccca0e0554",
        "name": "",
        "func": "msg.payload = md5(msg.payload);\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [
            {
                "var": "md5",
                "module": "md5"
            }
        ],
        "x": 760,
        "y": 1520,
        "wires": [
            [
                "5c3dc5fe300f2a32"
            ]
        ]
    },
    {
        "id": "5c3dc5fe300f2a32",
        "type": "debug",
        "z": "b733adccca0e0554",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 950,
        "y": 1520,
        "wires": []
    },
    {
        "id": "4cfe8d356f0407f5",
        "type": "file in",
        "z": "b733adccca0e0554",
        "name": "",
        "filename": "C:\\Users\\dumitru.maros\\.node-red\\doc\\trigger.txt",
        "format": "",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 460,
        "y": 1520,
        "wires": [
            [
                "e1f1324de713b421"
            ]
        ]
    }
]
2 Likes

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