-->
Page 1 of 1

Saving image on ESP8266 for use in HTML page

PostPosted: Sat Aug 13, 2016 11:18 am
by ma.ag37
Hi,

I want to save some images on ESP8266 module for their use in HTML page to be served to clients connected.
I tried sending the jpg image file to the module using ESPlorer but the file sent to the module seems to be damaged as the file size on module and my computer differs. I tried sending files back and forth, and the file received back on the computer from the modules is damaged as well.

Please help me in solving the issue

Re: Saving image on ESP8266 for use in HTML page

PostPosted: Sat Aug 13, 2016 12:58 pm
by ma.ag37
I got the image successfully transferred to the module without damage but I am unable to get it successfully delivered to the connected clients on the webpage.

I use the following code:


if received_request == "smarty_home.jpg " then
print("image request received\n")
file.open("smarty_home.jpg")
print("image_opened\n")

nextline = file.read(1400)
while nextline do
client:send(nextline)
nextline = file.read(1400)
end
file.close()
print ("image_sent\n")

end

But I get only a portion of image at the client on the webpage

Please Help