SimpleFTPServer Library 3.0.5

A lightweight Arduino/embedded library to expose a device filesystem over FTP, allowing uploads, downloads and remote file management from standard FTP clients (FileZilla, WinSCP, Explorer, etc.). This version supports a single FTP session.
Author: Renzo Mischianti
Website: www.mischianti.org
GitHub: xreef/SimpleFTPServer
📚 Documentation & Tutorials
Complete tutorials and platform-specific guides by the author are available on mischianti.org.
General Documentation
📋 Table of Contents
✨ Features
- Expose device filesystem via a single FTP session (upload, download, delete, rename, list)
- Resume support (REST) and RFC-like commands (ALLO, STAT, SYST, HELP)
- Passive (
PASV, EPSV) and active (PORT) data connections
- A second client (e.g. a FileZilla transfer connection) is accepted when the current session is idle (ESP32/ESP8266 WiFi, WiFiNINA, WiFiS3)
- UTF-8 filename support (configurable)
- Configurable buffers and timeouts via
FtpServerKey.h
- Works with internal flash filesystems (SPIFFS, LittleFS, FFAT) and external SD (SD, SdFat)
- Small footprint and simple API:
begin() and handleFTP()
🎯 Supported Platforms
| Platform |
Filesystems |
Notes |
| ESP32 |
SPIFFS, LittleFS, FFAT, SD, SD_MMC |
Full support, see examples |
| ESP8266 |
SPIFFS, LittleFS, SD |
Limited RAM vs ESP32 |
| RP2040 / Pico W |
LittleFS, SD |
See Pico W examples |
| STM32 |
SdFat, SPI flash |
Use SdFat examples |
| Arduino (AVR) |
SD (8.3), SdFat |
Mega 2560 + W5100/W5500 shield; use SdFat for better compatibility |
| Arduino SAMD (Nano 33 IoT, MKR WiFi 1010) |
SD, SdFat |
WiFiNINA (firmware >= 1.5.0), see Arduino_WiFiNINA_SD |
| Arduino UNO R4 WiFi |
SD (8.3) |
WiFiS3 + SPI microSD module (CS pin in SD.begin()) |
| Wio Terminal |
SdFat, Seed SD, native FAT |
See Wio examples |
⚠️ Note: Some older AVR boards (Uno/Mega) have limited RAM and may not support large transfers.
🌐 Supported Network Interfaces
- WiFi (ESP32, ESP8266, RP2040-W, WiFiNINA, WiFiS3 on Arduino UNO R4 WiFi)
- Ethernet (W5x00, W5500, ENC28J60, ESP32-ETH)
- Seeed RTL8720DN
💾 Supported Storage Systems
Internal flash
- SPIFFS (ESP8266/ESP32)
- LittleFS (ESP8266/ESP32/RP2040)
- FFAT (ESP32)
External storage
- SD (Arduino SD library)
- SdFat / SdFat2 (recommended)
- SD_MMC (ESP32)
- Adafruit_SPIFlash
📦 Installation
Arduino IDE (Library Manager)
- Open Arduino IDE
- Sketch > Include Library > Manage Libraries
- Search for "SimpleFTPServer" and install
Manual installation
- Copy the repository folder into your Arduino
libraries/ folder
- Restart Arduino IDE
PlatformIO
Add to platformio.ini:
lib_deps = xreef/SimpleFTPServer
🚀 Basic Usage
Quick start (ESP32 example)
#include <WiFi.h>
#include "SPIFFS.h"
#include <SimpleFTPServer.h>
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASS";
FtpServer ftpSrv;
void setup(){
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("Connected. IP: ");
Serial.println(WiFi.localIP());
// Mount filesystem before starting FTP
if (SPIFFS.begin(true)) {
Serial.println("SPIFFS opened!");
// username, password for ftp.
ftpSrv.begin("esp32","esp32");
}
}
void loop(){
ftpSrv.handleFTP();
}
⚙️ Configuration
See FtpServerKey.h for config defines and defaults. Key settings:
FTP_BUF_SIZE — transfer buffer size
FTP_TIME_OUT — inactivity timeout (seconds)
FTP_AUTH_TIME_OUT — authentication timeout (seconds)
FTP_DATA_CONNECT_TIMEOUT_MS — max wait for the data connection, passive or active (default 5000); handleFTP() blocks meanwhile, so keep it well below the client timeout (FileZilla: 20 s)
FTP_TRANSFER_STALL_TIMEOUT_MS — an upload with no data for this time is aborted with 426 (default 10000)
FTP_DATA_CLOSE_TIMEOUT_MS — NETWORK_W5100 only: max wait for the client to close the data connection at the end of a transfer before the Ethernet library resets it (default 5000; with the library default of 1 s a slow client lost the end of the file)
FTP_IDLE_PREEMPT_MS — ESP32/ESP8266 WiFi, WiFiNINA and WiFiS3: when another client is waiting and the logged-in session has been idle for this time, the idle session is closed and the new client accepted (default 1500, 0 disables it)
FTP_SERVER_DEBUG — enable debug messages (e.g. -D FTP_SERVER_DEBUG in build_flags)
DEBUG_PRINTER — debug output stream (defaults to Serial)
UTF8_SUPPORT — enable/disable UTF-8 support
Passive and active mode
Prefer passive mode (the FileZilla default). In active mode (PORT) the board opens the data connection towards the PC, so the PC firewall must accept incoming connections for the FTP client on the network profile in use: on Windows a rule that allows FileZilla only on Public networks blocks it on a Private one, and every listing or transfer fails with 425 No data connection after a few seconds.
With WiFiNINA (Arduino Nano 33 IoT, MKR WiFi 1010) the NINA module can close an active-mode data connection while the board is sending to a slower receiver: the server answers 426 and the transfer has to be repeated. Passive mode is not affected.
🧩 Included Examples
See the examples/ folder for ready-to-use sketches for many platforms (ESP32, ESP8266, RP2040, STM32, Wio Terminal, Arduino). Adapt SSID, credentials and SD pins as needed.
📝 Changelog