So if I try something like this:
WebServer.sendHeader("Content-Disposition", "attachment; filename=config.txt");
WebServer.setContentLength(2048);
client.write((const char*)data, 2048);
WebServer.send(200, "application/octet-stream", "");
all the headers are send after the data has been send and the browser does not understand the content.
It will not download to file but display the file contents and at the end the headers.
It seems I have to use something different then WebServer.send(200, "application/octet-stream", "") because you cannot send a header line after sending data...