Raspberry pi WebIOPi all pictures are 403 forbidden

252 views Asked by At

I'm writing a remote controlled car using a Raspberry Pi. My control interface is a website on the raspberry using WebIOPi to access my python all is working as hoped. Then I wanted to change my text buttons with images, but all I get is a 403.

<img src="images/stop.png" id="stop" class="img-responsive" alt="stop" />

GET http://172.30.1.26:8000/images/stop.png 403 ('utf-8' codec can't decode byte 0x89 in position 0: invalid start byte)

Its the first time I'm using a raspberry so there might just be an setting someplace I need to use, but I've looked everywhere and have not been able to find it yet.

1

There are 1 answers

0
Vezilka On BEST ANSWER

You should edit the file located in

/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.1-py3.5-linux-armv7l.egg/webiopi/protocols/http.py

inside you will find the line

f = codecs.open(path, encoding=encoding)

replace it with

f = codecs.open(path, 'rb')

That should fix your problem. Remember to restart webiopi when done.