[Ethernet + SD] Download zip files from SD

PaulS:
What is the browser going to do with a zip file?

The browser download the file to PC

PaulS:
You haven't demonstrated this.

The code:

EthernetClient client = server.available();
  if (client) {
    Serial1.println(F("new client"));
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    String vars;

    int varDL=0;
    int dlaio=0;

    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial1.write(c);
        vars.concat(c);

        if (vars.endsWith("=Download"))
        {
          varDL=1;
        }
        else if (vars.endsWith("/download/arduinoIO"))
        {
          varDL=1;
          dlaio=1;
        }

if (c == '\n' && currentLineIsBlank) {
          client.println(F("HTTP/1.1 200 OK"));
          client.println(F("Content-Type: text/html"));
          client.println(F("Connnection: close"));
          client.println();
          client.println(F("<!DOCTYPE HTML>"));
          client.println(F("<html>"));
          client.println(F("<head>"));
          // meta tag -> Faz refresh ao browser de 2 em 2 segundos
          client.println(F("<meta http-equiv=\"refresh\" content=\"2\">"));

(...)

if (varDL==1) // DOWNLOAD CENTER
          {
            client.println(F("<h1>Downloads</h1>"));
            client.println(F("<a href='/download/arduinoIO'>Matlab Support Package for Arduino (Arduino IO)</a>"));
          }
if (dlaio==1) // DOWNLOAD ARDUINO IO
          {
           //CODE FOR DOWNLOAD FILE
          }

(...)

PaulS:
The SD library comes with examples for listing the files on an SD card, and for reading from an SD card. Combining the relevant example with the web server code should be trivial. Read from a file and write to the client. Nothing really to it.

But the library only read/write txt files.