fix: filename uploads (#2831)
Co-authored-by: Christian Schwinne <dev.aircoookie@gmail.com>
This commit is contained in:
parent
7b2836c63c
commit
3c36030977
@ -37,10 +37,15 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t
|
||||
return;
|
||||
}
|
||||
if (!index) {
|
||||
request->_tempFile = WLED_FS.open(filename, "w");
|
||||
String finalname = filename;
|
||||
if (finalname.charAt(0) != '/') {
|
||||
finalname = "/" + finalname; // prepend slash if missing
|
||||
}
|
||||
|
||||
request->_tempFile = WLED_FS.open(finalname, "w");
|
||||
DEBUG_PRINT("Uploading ");
|
||||
DEBUG_PRINTLN(filename);
|
||||
if (filename == F("/presets.json")) presetsModifiedTime = toki.second();
|
||||
DEBUG_PRINTLN(finalname);
|
||||
if (finalname == "/presets.json") presetsModifiedTime = toki.second();
|
||||
}
|
||||
if (len) {
|
||||
request->_tempFile.write(data,len);
|
||||
|
Loading…
Reference in New Issue
Block a user