Strings in flash

pull/2850/head
Blaž Kristan 2022-10-24 18:49:02 +02:00 zatwierdzone przez GitHub
rodzic 5ba1ebd525
commit 2000d02768
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -39,20 +39,20 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t
if (!index) {
String finalname = filename;
if (finalname.charAt(0) != '/') {
finalname = "/" + finalname; // prepend slash if missing
finalname = '/' + finalname; // prepend slash if missing
}
request->_tempFile = WLED_FS.open(finalname, "w");
DEBUG_PRINT("Uploading ");
DEBUG_PRINT(F("Uploading "));
DEBUG_PRINTLN(finalname);
if (finalname.equals("/presets.json") >= 0) presetsModifiedTime = toki.second();
if (finalname.equals(F("/presets.json")) >= 0) presetsModifiedTime = toki.second();
}
if (len) {
request->_tempFile.write(data,len);
}
if (final) {
request->_tempFile.close();
if (filename.indexOf("cfg.json") >= 0) { // check for filename with or without slash
if (filename.indexOf(F("cfg.json")) >= 0) { // check for filename with or without slash
doReboot = true;
request->send(200, "text/plain", F("Configuration restore successful.\nRebooting..."));
} else