Hi everyone.
After a lot of projects I have stuck with this one because it is the first time I try to use Arduino as web server.
I can not whatever I tried to make png icons to appear on my web page.
Below you can find the code and the html file.
Any help appreciated.
Hi thanks for the reply, but could you please be more specific as i am not a programmer, just a netwoking admin doing this for hobby and just adjusting code from here and there.
If you could explain a little bit more i might could understand what the problem is as i have no idea of coding!!!!
Thank you once more.
You have a block of code that deals with index.htm. You have a block of code that deals with on.png.
Print each section of code on a separate piece of paper. Compare them line-by-line.
In the index.htm code, you actually read the file and print it to the client. In the on.png code, you open the file, but don't bother reading it or printing it to the client. Why?
(You'll actually need to write() it to the client, since it does not contain ASCII data.)
So i have to ad this on the on.png part on my arduino code?
Something like that, yes. Sending one byte per packet is wasteful, though. The read() method is overloaded to take an array and a size (the size of the array), and return the number of characters read. The write() function is also overloaded to take an array and a size. Set up a 32 byte array, and read up to 32 bytes. write() the bytes actually read (may be less than 32).
i finally resolved my problem by adding in the html code the jpg images ψονωερτεδ to base64 format.
I gave up trying doing it the "right way".
Nevertheless thank you for your time and patience.