Helps to increase the speed of transfer
Posted: Wed Jul 29, 2015 7:50 am
I am building an interface using JQuery , I could make everything work perfectly, but I have a speed problem.
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 ?
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 ?
Code: Select all
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);
}
}