diff --git a/esp3d/src/modules/http/handlers/handle-SD-files.cpp b/esp3d/src/modules/http/handlers/handle-SD-files.cpp index 7c09910e..cf3461f8 100644 --- a/esp3d/src/modules/http/handlers/handle-SD-files.cpp +++ b/esp3d/src/modules/http/handlers/handle-SD-files.cpp @@ -75,7 +75,9 @@ void HTTP_Server::handleSDFileList() { // get current path if (_webserver->hasArg("path")) { - path += _webserver->arg("path"); + path = _webserver->arg("path"); + } else { + path = "/"; } // to have a clean path path.trim(); diff --git a/esp3d/src/modules/http/handlers/handle-files.cpp b/esp3d/src/modules/http/handlers/handle-files.cpp index 234eb00c..783ac1cd 100644 --- a/esp3d/src/modules/http/handlers/handle-files.cpp +++ b/esp3d/src/modules/http/handlers/handle-files.cpp @@ -63,7 +63,9 @@ void HTTP_Server::handleFSFileList() { } // get current path if (_webserver->hasArg("path")) { - path += _webserver->arg("path"); + path = _webserver->arg("path"); + } else { + path = "/"; } // to have a clean path path.trim();