Commit 5b42b3c0 authored by Eric Duminil's avatar Eric Duminil
Browse files

No String anymore. :)

parent 318eb864
......@@ -262,7 +262,9 @@ namespace web_server {
}
if (FS_LIB.exists(csv_writer::filename)) {
fs::File csv_file = FS_LIB.open(csv_writer::filename, "r");
http.sendHeader("Content-Length", String(csv_file.size()));
char csv_size[10];
snprintf(csv_size, sizeof(csv_size), "%d", csv_file.size());
http.sendHeader("Content-Length", csv_size);
http.streamFile(csv_file, F("text/csv"));
csv_file.close();
} else {
......@@ -274,9 +276,9 @@ namespace web_server {
if (!shouldBeAllowed()) {
return http.requestAuthentication(DIGEST_AUTH);
}
Serial.print("Removing CSV file...");
Serial.print(F("Removing CSV file..."));
FS_LIB.remove(csv_writer::filename);
Serial.println(" Done!");
Serial.println(F(" Done!"));
http.sendHeader("Location", "/");
http.send(303);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment