Ok, I snipped out the relevant stuff.
The jpg is 35.5 KB.
Here's the calling code...
** if (strcmp(ext,"jpg")==0){**
** sendHeader("jpg.hdr", client;**
** sendFile(parameter, client);**
** return;**
** }**
Here's the text from the file jpg.hdr
HTTP/1.1 200 OK
Content-Type: image/jpeg
Code to send header...
void sendHeader(char *fileName, EthernetClient *client){ // no CGI parsing
** DEBUG_PRINTLN("sending header " << fileName << "\n\n" );**
** sendFile(fileName,client);**
** client->print ("\n\n"); // terminator for http headers**
}
Code to actually send...
void sendFile(char *fileName, EthernetClient *client){
** DEBUG_PRINTLN("sending file " << fileName << "\n" );**
** File source = openFile(fileName);**
** while (source.available()) {**
** byte byt = source.read();**
** client->write(byt);**
** }**
** source.close();**
}