* add date, time and version to export json #1024
This commit is contained in:
lumapu 2023-07-19 23:56:07 +02:00
parent 48594c565a
commit 308dc064fe
6 changed files with 17 additions and 3 deletions

View file

@ -184,9 +184,12 @@ class RestApi {
response = request->beginResponse(200, F("application/json; charset=utf-8"), tmp);
}
String filename = ah::getDateTimeStrFile(mApp->getTimezoneOffset());
filename += "_v" + String(mApp->getVersion());
response->addHeader("Content-Type", "application/octet-stream");
response->addHeader("Content-Description", "File Transfer");
response->addHeader("Content-Disposition", "attachment; filename=ahoy_setup.json");
response->addHeader("Content-Disposition", "attachment; filename=" + filename + "_ahoy_setup.json");
request->send(response);
fp.close();
}