# Cant Cast local file

**URL:** <https://discourse.nodered.org/t/cant-cast-local-file/48404>\
**Category:** General\
**Created:** [14 July 2021 12:43 UTC](https://discourse.nodered.org/t/cant-cast-local-file/48404 "2021-07-14T12:43:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Essalsolami](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/essalsolami/32/44894_2.png) [@Essalsolami](https://discourse.nodered.org/u/Essalsolami)\
**Post date:** [14 July 2021 12:43 UTC](https://discourse.nodered.org/t/cant-cast-local-file/48404/1 "2021-07-14T12:43:17Z")

</div>

I have a png file that i would like to cast it on TV. I put the "car.png" file in this path C:\Users\ASUSE\car.png, unfort i got this error "Not able to load media:Load failed Not able to load the media".

Any help would be appreciated.

 ![node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/7662b2cd512d941d272f671e6cf49083a7a63dd1.png)

```auto
[{"id":"dbab92a5.684af","type":"tab","label":"Flow 17","disabled":false,"info":""},{"id":"d5a6dd33.a0e28","type":"http in","z":"dbab92a5.684af","name":"","url":"endpoint/car.png","method":"get","upload":false,"swaggerDoc":"","x":120,"y":140,"wires":[["d59c8c4.b480d7","e7ed07e7.97da58"]]},{"id":"d59c8c4.b480d7","type":"file in","z":"dbab92a5.684af","name":"","filename":"car.png","format":"","chunk":false,"sendError":false,"encoding":"none","x":310,"y":260,"wires":[["87b9c5b8.526558","49056e53.5a32b"]]},{"id":"87b9c5b8.526558","type":"http response","z":"dbab92a5.684af","name":"","statusCode":"","headers":{"contentType":"image/png"},"x":500,"y":260,"wires":[]},{"id":"e7ed07e7.97da58","type":"debug","z":"dbab92a5.684af","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":140,"wires":[]},{"id":"49056e53.5a32b","type":"debug","z":"dbab92a5.684af","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":200,"wires":[]},{"id":"b72151a6.617e3","type":"cast-to-client","z":"dbab92a5.684af","name":"","url":"","contentType":"","message":"","language":"en","ip":"","port":"","volume":"","x":490,"y":360,"wires":[[]]},{"id":"2dbcc2cc.94f80e","type":"inject","z":"dbab92a5.684af","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"ip\":\"192.168.100.2\",\"url\":\"http://127.0.0.1:1880/endpoint/car\",\"contentType\":\"image/png\",\"volume\":5}","payloadType":"json","x":220,"y":320,"wires":[["b72151a6.617e3"]]},{"id":"60f067e8.57cd68","type":"inject","z":"dbab92a5.684af","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":260,"wires":[["d59c8c4.b480d7"]]}]

```

---

<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:** [14 July 2021 12:50 UTC](https://discourse.nodered.org/t/cant-cast-local-file/48404/2 "2021-07-14T12:50:53Z")

</div>

You have set the URL for Chromecast to play as `http://127.0.0.1:1880/endpoint/car`.

To the Chromecast, 127.0.0.1 is itself. Replace that with the IP of your node-red server.

Also, you set the endpoint to `endpoint/car.png` so you will need the URL to be `http://node-red-ip:1880/endpoint/car.png`

---

<div class="post-metadata">

**Author:** ![Essalsolami](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/essalsolami/32/44894_2.png) [@Essalsolami](https://discourse.nodered.org/u/Essalsolami)\
**Post date:** [14 July 2021 13:12 UTC](https://discourse.nodered.org/t/cant-cast-local-file/48404/3 "2021-07-14T13:12:55Z")

</div>

Thank you Steve for your response.

sorry, I didt understand the first Edit "To the Chromecast, 127.0.0.1 is itself. Replace that with the IP of your node-red server" if got it right, i alredy write the ip address of node red.

 ![node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e7dbd7e658493d7cc496ce1a9c3cd12f7a207d49.png)

````auto
[{"id":"dbab92a5.684af","type":"tab","label":"Flow 17","disabled":false,"info":""},{"id":"d5a6dd33.a0e28","type":"http in","z":"dbab92a5.684af","name":"","url":"endpoint/car.png","method":"get","upload":false,"swaggerDoc":"","x":120,"y":140,"wires":[["d59c8c4.b480d7","e7ed07e7.97da58"]]},{"id":"d59c8c4.b480d7","type":"file in","z":"dbab92a5.684af","name":"","filename":"car.png","format":"","chunk":false,"sendError":false,"encoding":"none","x":310,"y":260,"wires":[["87b9c5b8.526558","49056e53.5a32b"]]},{"id":"87b9c5b8.526558","type":"http response","z":"dbab92a5.684af","name":"","statusCode":"","headers":{"contentType":"image/png"},"x":500,"y":260,"wires":[]},{"id":"e7ed07e7.97da58","type":"debug","z":"dbab92a5.684af","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":140,"wires":[]},{"id":"49056e53.5a32b","type":"debug","z":"dbab92a5.684af","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":490,"y":200,"wires":[]},{"id":"b72151a6.617e3","type":"cast-to-client","z":"dbab92a5.684af","name":"","url":"","contentType":"","message":"","language":"en","ip":"","port":"","volume":"","x":490,"y":360,"wires":[[]]},{"id":"2dbcc2cc.94f80e","type":"inject","z":"dbab92a5.684af","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"ip\":\"192.168.100.2\",\"url\":\"http://127.0.0.1:1880/endpoint/car.png\",\"contentType\":\"image/png\",\"volume\":5}","payloadType":"json","x":220,"y":320,"wires":[["b72151a6.617e3"]]},{"id":"60f067e8.57cd68","type":"inject","z":"dbab92a5.684af","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":260,"wires":[["d59c8c4.b480d7"]]}]```
````

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [14 July 2021 13:43 UTC](https://discourse.nodered.org/t/cant-cast-local-file/48404/4 "2021-07-14T13:43:41Z")

</div>

The IP address `127.0.0.1` is a special address, it always points to the device making the request, so if you send the URL `http://127.0.0:1880/endpoint/car.png` to the Chromecast, the Chromecast will be the device making the request to fetch that content.

So the Chromecast will ask it's self for the file, which of course it will not be able to provide.

You are accessing Node-RED using `127.0.0.1` because the browser you are using is on the same machine as Node-RED. To access Node-RED from the Chromecast it will need to use the LAN IP address of you machine, it will start with `192.168.100.` but you will need to look up what actual address is.

On Windows you would run a the `ipconfig` command to find your machines IP address

---

<div class="post-metadata">

**Author:** ![Essalsolami](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/essalsolami/32/44894_2.png) [@Essalsolami](https://discourse.nodered.org/u/Essalsolami)\
**Post date:** [14 July 2021 13:49 UTC](https://discourse.nodered.org/t/cant-cast-local-file/48404/5 "2021-07-14T13:49:17Z")

</div>

Thank you guys i got it, that is very helpful

---

<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:** [28 July 2021 13:49 UTC](https://discourse.nodered.org/t/cant-cast-local-file/48404/6 "2021-07-28T13:49:19Z")

</div>

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