# Node-red-contrib-smb issue

**URL:** <https://discourse.nodered.org/t/node-red-contrib-smb-issue/67358>\
**Category:** General\
**Created:** [5 September 2022 15:35 UTC](https://discourse.nodered.org/t/node-red-contrib-smb-issue/67358 "2022-09-05T15:35:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BaconPancake](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/baconpancake/32/68217_2.png) [@BaconPancake](https://discourse.nodered.org/u/BaconPancake)\
**Post date:** [5 September 2022 15:35 UTC](https://discourse.nodered.org/t/node-red-contrib-smb-issue/67358/1 "2022-09-05T15:35:20Z")

</div>

Hello!

i am using node red v1.0.3 ( i cannot update it) and the node-red-contrib-smb is 1.2.0

I have developed a dashboard in which i an able to create (at designated times) some csv and json files containing some information acquired from OPC UA server.

the current setup is the following:  
i have a gateway device connected to a switch in which i have the device used in order to obtain node red. Hence i am able to get to the device via the gateway from an external pc

On node red, i have developed a dashboard which is able to create some csv file containing the daily information. I want my csv files to be downloadable on windows so that i can get something like a daily report.  
I have tried using this smb node but i am finding some issues in configuring it.

how should i configure it in order to download the csv files locally on windows inside the local download folder ? (supposing not to have a shared folder like a nas).

Suppose that i have a shared folder on a nas : i have tried to create some folders an files on that nas but i could not achieve a solution and i am a bit stuck. Can someone help me?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 September 2022 16:27 UTC](https://discourse.nodered.org/t/node-red-contrib-smb-issue/67358/2 "2022-09-05T16:27:32Z")

</div>

> [@BaconPancake](#):
>
> how should i configure it in order to download the csv files locally on windows inside the local download folder ? (supposing not to have a shared folder like a nas).

Present download links on the dashboard and use a HTTP-in ~ HTTP-Response nodes to create an end point.

Example...  
[https://flows.nodered.org/flow/db68bd4934cf46f39e6e453a348bc419](https://flows.nodered.org/flow/db68bd4934cf46f39e6e453a348bc419)

And instead of saving files on the device, you can generate the CSV on the fly and present it in the same way using HTTP-in ~ HTTP-Response nodes to generate and end point where data can be delivered to the client

---

<div class="post-metadata">

**Author:** ![BaconPancake](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/baconpancake/32/68217_2.png) [@BaconPancake](https://discourse.nodered.org/u/BaconPancake)\
**Post date:** [6 September 2022 06:59 UTC](https://discourse.nodered.org/t/node-red-contrib-smb-issue/67358/3 "2022-09-06T06:59:22Z")

</div>

Hello Steve-Mcl,

i have tried your approach following the proposed example ( i did not do any modification to it ): i am able to see the dashboard page where i have the two .log files that can be downloaded but , as i press on the link, the following page appears

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

this is a page of the device (on which there is node red mounted) that i am using. It looks like i am not able to perform any download. Do you have any hints?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [6 September 2022 07:21 UTC](https://discourse.nodered.org/t/node-red-contrib-smb-issue/67358/4 "2022-09-06T07:21:10Z")

</div>

> [@BaconPancake](#):
>
> as i press on the link, the following page appears

That is to be expected since ...

> [@BaconPancake](#):
>
> i did not do any modification to it

The notes on that demo flow explicitly state

> - The base folder on your server is setup in the function node `Set base path`. Adjust this to point at the folder from where the files you wish to server are saved.

> [@BaconPancake](#):
>
> i have the two .log files that can be downloaded

That statement is incorrect. You have 2 hyperlinks that request files that probably dont exist.  
Look inside the template - these two links are hard coded to request fixed files.

* * *

As I inferred in my original reply - that was an " **example**" (i.e. not a complete solution)

and

> [@Steve-Mcl](#):
>
> instead of saving files on the device, you can generate the CSV on the fly and present it in the same way using HTTP-in ~ HTTP-Response nodes to generate and end point where data can be delivered to the client

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [6 September 2022 07:28 UTC](https://discourse.nodered.org/t/node-red-contrib-smb-issue/67358/5 "2022-09-06T07:28:13Z")

</div>

This demo is a more complete demo...

> [@Unable to download files from the browser](https://discourse.nodered.org/t/unable-to-download-files-from-the-browser/51314/6):
>
> Then you will need to list the files in the directory & present them as download links. Something like... Result... Flow... [{"id":"f31a598d.9fd2c8","type":"function","z":"553814a2.1248ec","name":"Set base path","func":"//restrict to c:\\temp\\\nvar basePath = flow.get(\"basePath\");\nvar filename = msg.req.params.fn;\n\n\nif(filename.includes(\"..\\\\\")){\n msg.payload = \"Illegal file path\";\n msg.statusCode = 405;//not allowed\n return [null, msg];//fire ou…

Again, you will need to adjust parts of it to make it read files from a specific directory on YOUR device (i.e. not a random windows type folder)

---

<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:** [5 November 2022 07:28 UTC](https://discourse.nodered.org/t/node-red-contrib-smb-issue/67358/6 "2022-11-05T07:28:20Z")

</div>

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