When you send an image or a file that is not HTML I am using the routine below.
Works but believe she is to blame for the low speed.
Any ideas on how to improve ?
String arq;
if (dataType == "text/html") {
while (dataFile.available()) {
arq += char(dataFile.read());
}
server.send(200, dataType, arq);
} else {
char a[500];
WiFiClient client = server.client();
while (dataFile.available()) {
for (int i = 0; i < 500; i++) {
a[i] = dataFile.read();
}
client.write(&a[0], 500);
}
}