Web Server + SPIFFS Image
Posted: Tue May 30, 2017 10:12 pm
I thought this would be easy but I can't seem to figure out how to use an image in SPIFFS in an html page. I have no problem serving up the html document and including a image with a URL reference; however, when accessing the ESP8266 via the Access Point causes this image to not load and I would like to retrieve the image from SPIFFS instead. I've confirmed the image has been successfully loaded into SPIFFS as well.
I thought the basic version below would work but it does not:
...<h2><img id="myImg" src=""</h2>...
...window.onload = function ()
{
setLogo();
}...
...function setLogo(){
document.getElementById('myImg').src='../Logo.png';
}
Does anyone know of a simple example of using an image in SPIFFS? Thanks.
I thought the basic version below would work but it does not:
...<h2><img id="myImg" src=""</h2>...
...window.onload = function ()
{
setLogo();
}...
...function setLogo(){
document.getElementById('myImg').src='../Logo.png';
}
Does anyone know of a simple example of using an image in SPIFFS? Thanks.