https://github.com/esp8266/Arduino/tree ... /FSBrowser
Pass the path to the file and descriptor to server.streamFile, in the sketch / html just use message += "<body background=\"/eye.gif\">";
//Use this to send an Image or File from SPIFFS
void loadImg(String path, String TyPe)
{ // path=Filename(including root "/"), TyPe= html descriptor
if(SPIFFS.exists(path)){
File file = SPIFFS.open(path, "r");
server.streamFile(file, TyPe);
file.close();
}
}
in setup
// Any Images need to be uploaded to SPIFFS...!!!
server.on("/eye.gif", []() { loadImg("/flame.gif", "image/gif"); } ); // or jpg
https://www.arduino.cc/reference/en/language/functions/communication/stream/
I simply got confused. My experience is limited, I was wondering if you could elaborate on your example a bit. Or perhaps point me to some examples. I am very much interested in understanding this particular action using the 8266. Can this process be incorporated into say an HTML button object or other uses? That is one of my goals. Thanks and much obliged for any steering..