Skip to content

Commit

Permalink
Fix sd file path xreef#19
Browse files Browse the repository at this point in the history
  • Loading branch information
xreef committed Jul 6, 2022
1 parent 1bf9b33 commit 97f6fed
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
9 changes: 6 additions & 3 deletions FtpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ uint8_t FtpServer::handleFTP() {

void FtpServer::clientConnected()
{
DEBUG_PRINTLN( F(" Client connected!") );
DEBUG_PRINTLN( F(" Client connected!") );
client.print(F("220---")); client.print(welcomeMessage); client.println(F(" ---"));
client.println(F("220--- By Renzo Mischianti ---"));
client.print(F("220 -- Version ")); client.print(FTP_SERVER_VERSION); client.println(F(" --"));
Expand Down Expand Up @@ -1409,7 +1409,7 @@ bool FtpServer::doList()
// data.println( fileDir.name() );

String fn = fileDir.name();
fn.remove(0, fn.lastIndexOf("/")+1);
if (fn[0]=='/') { fn.remove(0, fn.lastIndexOf("/")+1); }

generateFileLine(&data, fileDir.isDirectory(), fn.c_str(), long( fileDir.size()), "Jan 01 00:00", this->user);

Expand All @@ -1427,7 +1427,10 @@ bool FtpServer::doList()
// }
// data.println( dir.fileName() );

generateFileLine(&data, dir.isDir(), dir.fileName(), long( dir.fileSize()), "Jan 01 00:00", this->user);
String fn = dir.fileName();
if (fn[0]=='/') { fn.remove(0, fn.lastIndexOf("/")+1); }

generateFileLine(&data, dir.isDir(), fn.c_str(), long( dir.fileSize()), "Jan 01 00:00", this->user);

nbMatch ++;
return true;
Expand Down
2 changes: 1 addition & 1 deletion FtpServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef FTP_SERVER_H
#define FTP_SERVER_H

#define FTP_SERVER_VERSION "2022-03-11"
#define FTP_SERVER_VERSION "2.1.2 (2022-07-06)"

#if ARDUINO >= 100
#include "Arduino.h"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
- Wio Terminal (SdFat 2, Seed SD, and native FAT)

#### Changelog
- 2022-05-21 2.1.1 Minor fix
- 2022-05-21 2.1.2 Fix SD path (#19)
- 2022-05-21 2.1.1 Minor fix
- 2022-03-30 2.1.0 Add UTF8 support and enabled It by default (Thanks to @plaber)
- 2022-03-30 2.0.0 Complete support for STM32 with SD and SPI Flash minor bux fix and HELP command support
- 2022-03-17 1.3.0 Fix enc28j60 and w5500 support and restructuring for local settings
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"url": "https://www.mischianti.org",
"frameworks": "Arduino",
"version": "2.1.1",
"version": "2.1.2",
"platforms": "*"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SimpleFTPServer
version=2.1.1
version=2.1.2
author=Renzo Mischianti <[email protected]>
maintainer=Renzo Mischianti <[email protected]>
sentence=Simple FTP server for esp8266, esp32 and Arduino
Expand Down

0 comments on commit 97f6fed

Please sign in to comment.