user30840: I have a code that uploads the temperature and humidity from a dht22 to a website. 
Now i want to add an image to the "add to homescreen" button in safari on ios. 
Apple has a html code for this:
<link rel="apple-touch-icon" href="/custom_icon.png">

Now I want the "custom_icon.png" to be a link or some other method to a file "Icon.png" on the ethernet shield sd card. 
I think I need something like this:
client.println("<link rel=\"apple-touch-icon\" href=\"/Icon.png\">");

But this doensn't work. It doesn't give an error, but its just the wrong way to acces that file.
I tried using the SD.h library but I am not able to use the library for my code. This is my code.
#include <dht.h>
#define dht_apin A0                                  

#include <SPI.h>
#include <SD.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>

File root;
// initialize the library with the numbers of the interface pins

byte mac[] = {I HIDE THIS};   // physical mac address
byte ip[] = {I HIDE THIS};                        // ip in lan (that's what you need to use in your browser. ("I HIDE THIS")
byte gateway[] = {I HIDE THIS};                   // internet access via router
byte subnet[] = {I HIDE THIS};                  // subnet mask
EthernetServer server(10000);                          // server port  
String readString;
dht DHT;
int Temp;

void setup() {
  // set up the LCD's number of columns and rows:
  Serial.begin(9600);
   while (!Serial) {
    ; 
  }
  delay(100);
  Serial.println("DHT11 Humidity & temperature Sensor\n\n");

  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());

    Serial.print("Initializing SD card...");

  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");


 Serial.println("done!");


}

void loop() {



  EthernetClient client = server.available();    // Create a client connection
  if (client) {
    while (client.connected()) { 
      if (client.available()) {
        char c = client.read();

        if (readString.length() < 100) {    //read char by char HTTP request
          readString += c;
         }

         if (c == '\n') {      //if  HTTP request has ended
          Temp = 0;
  switch (Temp){
  case 0:
           DHT.read22(dht_apin);
           Serial.print("Vochtigheid = ");
           Serial.print(DHT.humidity);
           Serial.print("%  ");
           Serial.print("Temperatuur = ");
           Serial.print(DHT.temperature);


           delay(500);


           File dataFile = SD.open("Icon.png");

           client.println("HTTP/1.1 200 OK"); //send new page
           client.println("Content-Type: text/html");
           client.println();     
           client.println("<HTML>");
           client.println("<HEAD>");
           client.println("<TITLE>Home Damian</TITLE>");
           client.println("<meta http-equiv=\"refresh\"content=\"1 \">");
           client.println("<meta name=\"apple-mobile-web-app-title\" content=\"Home\">");
           client.println("<link rel=\"apple-touch-icon\" href=\"/Icon.png"/>");
           client.println("<meta name=\"apple-mobile-web-app-capable\" content=\"yes\">");
           client.println("<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\">");
           client.println("</HEAD>");
           client.println("<BODY bgcolor=\"#273B46\">");
           client.println("<br />");   
           client.println("<p><font color=\"white\">Temperatuur = </p>");  
           client.println(DHT.temperature,1); 
           client.print("&#176C"); 
           client.println("<p></p>");
           client.println("<p><font color=\"white\">Vochtigheid = </p>");  
           client.println(DHT.humidity,1);
           client.print("%"); 
           client.println("<br />"); 
           client.println("</BODY>");
           client.println("</HTML>");

           delay(1000);
           Serial.println("OK");
           Temp = 0;
           client.stop();

         }
       }
     }
   }
  }
}


void printDirectory(File dir, int numTabs) {
  while (true) {

    File entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }
    for (uint8_t i = 0; i < numTabs; i++) {
      Serial.print('\t');
    }
    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs + 1);
    } else {
      // files have sizes, directories do not
      Serial.print("\t\t");
      Serial.println(entry.size(), DEC);
    }
    entry.close();
  }
}


user53952: The Arduino uses the 8.3 File Format. meaning that your filename must not be more than 8 characters and the file extension must not be more than 3 characters.
eg:
picture1.png
12345678.123
Hope that helps.
I have been toying with this for the last few days, and managed to find out that it uses the 8.3 format.
Also the index.html must also be in the 8.3 format.
so index.htm
Hope that helps.

30840: <p>I have a code that uploads the temperature and humidity from a dht22 to a website. </p>

<p>Now i want to add an image to the "add to homescreen" button in safari on ios. </p>

<p>Apple has a html code for this:</p>

<pre><code>&lt;link rel="apple-touch-icon" href="/custom_icon.png"&gt;
</code></pre>

<p>Now I want the "custom_icon.png" to be a link or some other method to a file "Icon.png" on the ethernet shield sd card. </p>

<p>I think I need something like this:</p>

<pre><code>client.println("&lt;link rel=\"apple-touch-icon\" href=\"/Icon.png\"&gt;");
</code></pre>

<p>But this doensn't work. It doesn't give an error, but its just the wrong way to acces that file.</p>

<p>I tried using the SD.h library but I am not able to use the library for my code. This is my code.</p>

<pre><code>#include &lt;dht.h&gt;
#define dht_apin A0                                  

#include &lt;SPI.h&gt;
#include &lt;SD.h&gt;
#include &lt;Ethernet.h&gt;
#include &lt;LiquidCrystal.h&gt;

File root;
// initialize the library with the numbers of the interface pins

byte mac[] = {I HIDE THIS};   // physical mac address
byte ip[] = {I HIDE THIS};                        // ip in lan (that's what you need to use in your browser. ("I HIDE THIS")
byte gateway[] = {I HIDE THIS};                   // internet access via router
byte subnet[] = {I HIDE THIS};                  // subnet mask
EthernetServer server(10000);                          // server port  
String readString;
dht DHT;
int Temp;

void setup() {
  // set up the LCD's number of columns and rows:
  Serial.begin(9600);
   while (!Serial) {
    ; 
  }
  delay(100);
  Serial.println("DHT11 Humidity &amp; temperature Sensor\n\n");

  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());

    Serial.print("Initializing SD card...");

  if (!SD.begin(4)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");


 Serial.println("done!");


}

void loop() {



  EthernetClient client = server.available();    // Create a client connection
  if (client) {
    while (client.connected()) { 
      if (client.available()) {
        char c = client.read();

        if (readString.length() &lt; 100) {    //read char by char HTTP request
          readString += c;
         }

         if (c == '\n') {      //if  HTTP request has ended
          Temp = 0;
  switch (Temp){
  case 0:
           DHT.read22(dht_apin);
           Serial.print("Vochtigheid = ");
           Serial.print(DHT.humidity);
           Serial.print("%  ");
           Serial.print("Temperatuur = ");
           Serial.print(DHT.temperature);


           delay(500);


           File dataFile = SD.open("Icon.png");

           client.println("HTTP/1.1 200 OK"); //send new page
           client.println("Content-Type: text/html");
           client.println();     
           client.println("&lt;HTML&gt;");
           client.println("&lt;HEAD&gt;");
           client.println("&lt;TITLE&gt;Home Damian&lt;/TITLE&gt;");
           client.println("&lt;meta http-equiv=\"refresh\"content=\"1 \"&gt;");
           client.println("&lt;meta name=\"apple-mobile-web-app-title\" content=\"Home\"&gt;");
           client.println("&lt;link rel=\"apple-touch-icon\" href=\"/Icon.png"/&gt;");
           client.println("&lt;meta name=\"apple-mobile-web-app-capable\" content=\"yes\"&gt;");
           client.println("&lt;meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\"&gt;");
           client.println("&lt;/HEAD&gt;");
           client.println("&lt;BODY bgcolor=\"#273B46\"&gt;");
           client.println("&lt;br /&gt;");   
           client.println("&lt;p&gt;&lt;font color=\"white\"&gt;Temperatuur = &lt;/p&gt;");  
           client.println(DHT.temperature,1); 
           client.print("&amp;#176C"); 
           client.println("&lt;p&gt;&lt;/p&gt;");
           client.println("&lt;p&gt;&lt;font color=\"white\"&gt;Vochtigheid = &lt;/p&gt;");  
           client.println(DHT.humidity,1);
           client.print("%"); 
           client.println("&lt;br /&gt;"); 
           client.println("&lt;/BODY&gt;");
           client.println("&lt;/HTML&gt;");

           delay(1000);
           Serial.println("OK");
           Temp = 0;
           client.stop();

         }
       }
     }
   }
  }
}


void printDirectory(File dir, int numTabs) {
  while (true) {

    File entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }
    for (uint8_t i = 0; i &lt; numTabs; i++) {
      Serial.print('\t');
    }
    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs + 1);
    } else {
      // files have sizes, directories do not
      Serial.print("\t\t");
      Serial.println(entry.size(), DEC);
    }
    entry.close();
  }
}
</code></pre>
 53952: <p>The Arduino uses the 8.3 File Format. meaning that your filename must not be more than 8 characters and the file extension must not be more than 3 characters.</p>

<p>eg:
picture1.png
12345678.123</p>

<p>Hope that helps.</p>

<p>I have been toying with this for the last few days, and managed to find out that it uses the 8.3 format.</p>

<p>Also the index.html must also be in the 8.3 format.
so index.htm</p>

<p>Hope that helps.</p>
