0

I have an image stored in SPIFFS When I launch the browser and put in the esp8266 IP address/images/image.jpg I can see the image. The image also shows in the index.html page in the root.

When I generate a page with

server.send(500, "text/html", "<head><title>esp8266</title></head><body><div id=\"banner\"><img src=\"/images/image.jpg\" width=\"900\" height=\"295\" /></div>  <div id=\"page\"></body</html>");

The page does not show the image, just a image placeholder. AND I can no longer access the image via IP address/images/image.jpg. I'm thinking that server.send() changes the context of the root.

Thank You for any help.

Jan Černý
  • 1,268
  • 2
  • 17
  • 31

1 Answers1

0

First thing that I would do in this situation is try to serve that html page as a static file and see if it works. For example

server.serveStatic("/index.html", SPIFFS, "/static/index.html");

Or maybe this all happens just because of malformed HTML.

<div id=\"page\"></body</html>