Hi there, I have a Feather S3 4MB no PSRAM and I cannot get SPIFFS to work... maybe it expects to be in the nonexistent PSRAM, but I digress.
I know that if I could get SPIFFS to work, then in both the ESP32 AsyncWebServer and ESP8266WebServer I could serve the files statically like this:
WebServer.serveStatic(uri.c_str(), SPIFFS, filename.c_str());
And finally, I know that I can probably try and change to LittleFS of FatFS...
I am still here because I don't want to do any of these things ![]()
I have seen base64 encoded IMG tags, but this is not that either. Let's go with I want to serve my favicon.ico when the browser asks for it... which Chrome always does. So I want to register a handler like this:
WebServer.on(uri.c_str(), HTTP_GET, func);
and then in the func() I want to create the image and return it:
void serverResponse(int code, String type, String content) {
#ifdef ESP32
if (__request) {
__request->send(code, type, content);
}
#else
WebServer.send(code, type, content);
#endif
}
with code being 200, type being "image/png" for example, and content being the magic I want to create.
I saw somewhere that someone coded an image into a byte array... I think... and returned that... I can't remember, and I can't find any reference to it.
Does anyone have any ideas on how I can do this?
Thanks in advance.