-
Hi. I've already split my webpage into html, css and script files. Now I've tried adding a small base64 image as a separate PROGMEM header file as well. But I think it's too large and is being truncated by the 2k limit. Is there a fix or workaround for this combination of controller and library? Many thanks for the library. Great work. Richard. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Normally, large file will be sent by chunks, not the whole file at once. Check ESP32_FS_EthernetWebServer example where large files, in data folder are sent via Ethernet without any issue. Use that example with ESP32 to test your code, file before moving to Teensy 4.1 + QNEthernet If you have issue with QNEthernet, please post the problem in the QNEthernet issues |
Beta Was this translation helpful? Give feedback.
-
thanks. I will try an ESP32. Should the send_P command work? as I'm getting the following error. no matching function for call to 'EthernetWebServer::send_P(int, const char [23], String&)' |
Beta Was this translation helpful? Give feedback.
-
You have to use for Teensy 4.1
instead of
|
Beta Was this translation helpful? Give feedback.
-
Thank you once again. The file is being sent to the browser, but I think I have the content type set incorrectly? index.h logo.h app.ino
The browser doesn't render the image. |
Beta Was this translation helpful? Give feedback.
-
Ok, I have a solution. I've added a fetch in the javascript, that pulls the base64 image and replaces the HTML image src with the received text. There's probably a better way, but this does seem to work. index.h logo.h app.ino
script.h
|
Beta Was this translation helpful? Give feedback.
Ok, I have a solution.
I've added a fetch in the javascript, that pulls the base64 image and replaces the HTML image src with the received text.
There's probably a better way, but this does seem to work.
index.h
<img src="logo" width="50" height="50" alt="logo" />
logo.h
const char logo[] PROGMEM =R"rawLiteral(iVBORw0KGgoAAAANSUhEUgAAABQAA ........ )rawLiteral";
app.ino
server.on("/logo", handleLogo);
void handleLogo(){ server.send_P(200,"text/plain",logo); }
script.h