Without it, it may not send the last packet. There may have been less than 64 bytes in clientBuf.
Good point, I went and added it back like below. Next project is to get all the file uploading into a single function.
if (myFile) {
byte clientBuf[64];
int clientCount = 0;
while(myFile.available())
{
clientBuf[clientCount] = myFile.read();
clientCount++;
if(clientCount > 63)
{
// Serial.println("Packet");
client.write(clientBuf,64);
clientCount = 0;
}
}
//final <64 byte cleanup packet
if(clientCount > 0) client.write(clientBuf,clientCount);
// close the file:
myFile.close();
}