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

**URL:** <https://discourse.nodered.org/t/help-i-dont-know-what-variable-to-send-to-node-md5-file/63413>\
**Category:** General\
**Created:** [3 June 2022 09:43 UTC](https://discourse.nodered.org/t/help-i-dont-know-what-variable-to-send-to-node-md5-file/63413 "2022-06-03T09:43:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dumy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dumy/32/50320_2.png) [@Dumy](https://discourse.nodered.org/u/Dumy)\
**Post date:** [3 June 2022 09:43 UTC](https://discourse.nodered.org/t/help-i-dont-know-what-variable-to-send-to-node-md5-file/63413/1 "2022-06-03T09:43:34Z")

</div>

I use this node

> **[node-red-contrib-md5file](https://flows.nodered.org/node/node-red-contrib-md5file)**
>
> A node-red node to calculate an MD5 hash for a give file.

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/5/e5906a67ed01cdc9d71449c98464094225052615.png)

No such file or directory

```auto
[
    {
        "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"
            ]
        ]
    }
]

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [3 June 2022 09:46 UTC](https://discourse.nodered.org/t/help-i-dont-know-what-variable-to-send-to-node-md5-file/63413/2 "2022-06-03T09:46:48Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![Dumy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dumy/32/50320_2.png) [@Dumy](https://discourse.nodered.org/u/Dumy)\
**Post date:** [3 June 2022 09:52 UTC](https://discourse.nodered.org/t/help-i-dont-know-what-variable-to-send-to-node-md5-file/63413/3 "2022-06-03T09:52:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dumy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dumy/32/50320_2.png) [@Dumy](https://discourse.nodered.org/u/Dumy)\
**Post date:** [3 June 2022 10:13 UTC](https://discourse.nodered.org/t/help-i-dont-know-what-variable-to-send-to-node-md5-file/63413/4 "2022-06-03T10:13:01Z")

</div>

I found solution  
simple import module md5

msg.payload = md5(msg.payload); 😃 😃

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b42fa759b40e13fd93f30bc8a54f0e43e42fada.png)

```auto
[
    {
        "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"
            ]
        ]
    }
]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 June 2022 10:13 UTC](https://discourse.nodered.org/t/help-i-dont-know-what-variable-to-send-to-node-md5-file/63413/5 "2022-06-17T10:13:34Z")

</div>

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