Hi there, just use "server.streamfFle".....
Pass the path to the file and descriptor to server.streamFile, in the sketch / html just use message += "<body background=\"/eye.gif\">";
Code: Select all
//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