From c4e31ad33caafb76428dbb8c9cbd0d6b3421e53e Mon Sep 17 00:00:00 2001 From: cat_in_136 Date: Sat, 18 Jun 2022 23:50:27 +0900 Subject: [PATCH] Fix LIST file name in case of STORAGE_TYPE == STORAGE_SD LIST shall returns file names but actually full path in case of STORAGE_TYPE == STORAGE_SD. --- FtpServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FtpServer.cpp b/FtpServer.cpp index dc6c745..0aaf6b3 100644 --- a/FtpServer.cpp +++ b/FtpServer.cpp @@ -1408,7 +1408,10 @@ bool FtpServer::doList() // data.print( F(",\t") ); // data.println( fileDir.name() ); - generateFileLine(&data, false, fileDir.name(), long( fileDir.size()), "Jan 01 00:00", this->user); + String fn = fileDir.name(); + fn.remove(0, fn.lastIndexOf("/")+1); + + generateFileLine(&data, fileDir.isDirectory(), fn.c_str(), long( fileDir.size()), "Jan 01 00:00", this->user); nbMatch ++; return true;