\n" ) ;
-
- // **************************************************
- // ESP32
- // **************************************************
- #ifdef ESP32
- fs::File dir = SPIFFS.open ( Path ) ;
- fs::File file = dir.openNextFile () ;
- while ( file ) {
- String Filename = String ( file.name() ).substring(1) ;
- if ( Ends.length() == 0 || Filename.endsWith ( Ends ) ) {
- Result = "" ;
- int x1 = Filename.indexOf ( '.' ) ;
- FileExt = Filename.substring ( x1+1 );
- FileExt.toLowerCase() ;
- Result = "" ;
- //if ( FileExt.endsWith ( "csv" ) ) {
- if ( FileExt == "csv" ) {
- Result += F("" ;
- }
- Result += " | " + Filename + " | " + String ( file.size() ) ;
-
- Result += " | Download | |
\n") ;
-
- My_Webserver.sendContent ( Result.c_str() ) ;
- delay(40);
- yield() ;
- }
- file = dir.openNextFile () ;
- }
-
- // **************************************************
- // ESP8266
- // **************************************************
- #else
- fs::Dir dir = SPIFFS.openDir ( Path ) ;
- while ( dir.next() ) {
- String Filename = String(dir.fileName()).substring(1) ;
- if ( Ends.length() == 0 || Filename.endsWith ( Ends ) ) {
- Result = "" ;
- fs::File file = dir.openFile ( "r" ) ;
- Filename = String(dir.fileName()).substring(1) ;
- //Line = Filename + " [" + String ( file.size() ) + "]" ;
- //Line = Filename + "" + String ( file.size() ) + " | " ;
-
- int x1 = Filename.indexOf ( '.' ) ;
- FileExt = Filename.substring ( x1+1 );
- FileExt.toLowerCase() ;
-//Serial.println ( x1 ) ;
-//Serial.println ( FileExt );
- Result = " | " ;
- //if ( FileExt.endsWith ( "csv" ) ) {
- if ( FileExt == "csv" ) {
- Result += F("" ;
- }
- Result += " | " + Filename + " | " + String ( file.size() ) ;
-
- Result += " | Download | |
\n") ;
-
- My_Webserver.sendContent ( Result.c_str() ) ;
- delay(40);
- yield() ;
-
- }
- }
- #endif
- My_Webserver.sendContent ( "