Pages: [1]   Go Down
Author Topic: Problem to show an image on website  (Read 679 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
Karma: 0
Posts: 53
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi ,
I've a little problem , i need to show an image on website from SDcard but i didn't get it works .
I've an arduino UNO ethernet

sample code :

// envoi d'une entete standard de réponse http
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          // envoie les chaines de caractères voulues = du code HTML
            //---- debut de la page HTML(begin of page) ---
             // ---- Entete de la page HTML( header of page) ----
             client.println("<meta content=\"text/html; charset=ISO-8859-1\" http-equiv=\"Content-Type\">");
             client.println("<title>Connexion au Serveur Arduino</title>");
             // balise meta pour réactualisation automatique de la page Web toutes les n secondes ( refresh of page )
             client.println("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"5\">");
             //----- Corps de la page HTML ( body of page )---
             client.println("<font color=");
             client.print(byte(34)),client.print(">") ; 
             if (strstr("image.jpg", ".jpg") != 0){   //
               client.println("Content-Type: image/jpeg");
             client.print("<img src="),client.print(byte(34));
             client.print("logo_edf.jpg");                                // image display
             client.print(byte(34)),client.print(">") ; 
             client.println("<br />");
       theFile.close(); // close       
             client.println("</html>");//---- fin de la page HTML(end of pages)
Sorry for my english ^^' and i accept all help thank you smiley


Offline Offline
Edison Member
Karma: 9
Posts: 1015
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Instead of writing the text "client.print("logo_edf.jpg")", you have to get the file from the SD card.
So you have to use SD.begin,, and so on.

There are good examples for that, you could start here :

Pages: [1]   Go Up
Jump to: