# How to download a webcam picture from URL and save it to folder

**URL:** https://discourse.nodered.org/t/how-to-download-a-webcam-picture-from-url-and-save-it-to-folder/56674
**Category:** General
**Created:** [14 January 2022 21:37 UTC](https://discourse.nodered.org/t/how-to-download-a-webcam-picture-from-url-and-save-it-to-folder/56674 "2022-01-14T21:37:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![gotsila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gotsila/32/43403_2.png) [@gotsila](https://discourse.nodered.org/u/gotsila)
#### Post date: [14 January 2022 21:37 UTC](https://discourse.nodered.org/t/how-to-download-a-webcam-picture-from-url-and-save-it-to-folder/56674/1 "2022-01-14T21:37:11Z")

</div>

Hello,  
i want to download the webcam picture from [https://regiowebcam.de/fileadmin/user\_upload/01\_storch\_kirchzarten2021.jpg?ver=1639302266349](https://regiowebcam.de/fileadmin/user_upload/01_storch_kirchzarten2021.jpg?ver=1639302266349) and save it to a folder.  
i want this to do later with Davinci Resolve a small timewarp Video about the week of the "Störche"

Which nodes are the things for me?

thx

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [15 January 2022 07:50 UTC](https://discourse.nodered.org/t/how-to-download-a-webcam-picture-from-url-and-save-it-to-folder/56674/2 "2022-01-15T07:50:44Z")

</div>

Hello ..

Here is an example of a flow that uses the http-request node to pull the image (data buffer) and later save it with the use of File write node.

I tried to used a Function node in between to generate a unique name for the image filename.  
(it may need a little tweeking. I used the date as a filename - you may need to change that)

**Example Flow:**

```auto
[{"id":"92cc7228ab7e22ce","type":"inject","z":"54efb553244c241f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":290,"y":1020,"wires":[["6fdf067fdc5f4ca6"]]},{"id":"6fdf067fdc5f4ca6","type":"http request","z":"54efb553244c241f","name":"","method":"GET","ret":"bin","paytoqs":"ignore","url":"https://regiowebcam.de/fileadmin/user_upload/01_storch_kirchzarten2021.jpg?ver=1639302266349","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"credentials":{},"x":480,"y":1020,"wires":[["337ff149a1b382ad"]]},{"id":"3174f03bedd6f49b","type":"file","z":"54efb553244c241f","name":"","filename":"","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"none","x":880,"y":1020,"wires":[[]]},{"id":"91a3b46f1bebdf71","type":"debug","z":"54efb553244c241f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":830,"y":920,"wires":[]},{"id":"337ff149a1b382ad","type":"function","z":"54efb553244c241f","name":"","func":"let now = new Date().toISOString().replace(/:/g, \"-\")\n//node.warn(now);\n\nmsg.filename = `c:\\\\users\\\\user\\\\desktop\\\\${now}.jpg`\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":1020,"wires":[["3174f03bedd6f49b","91a3b46f1bebdf71"]]}]

```

---

<div class="post-metadata">

### Author: ![gotsila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gotsila/32/43403_2.png) [@gotsila](https://discourse.nodered.org/u/gotsila)
#### Post date: [15 January 2022 14:17 UTC](https://discourse.nodered.org/t/how-to-download-a-webcam-picture-from-url-and-save-it-to-folder/56674/3 "2022-01-15T14:17:31Z")

</div>

That's do the trick - thanks a lot, for the quick help

> let now = new Date().toISOString().replace

doesn't work. that's not a big deal, becausei got my own time-routine

For me works:

> var dt = new Date(Date());

---

<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: [29 January 2022 14:17 UTC](https://discourse.nodered.org/t/how-to-download-a-webcam-picture-from-url-and-save-it-to-folder/56674/4 "2022-01-29T14:17:40Z")

</div>

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