A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/dplasa/FTPClientServer below:

dplasa/FTPClientServer: Simple FTP Server and Client for the esp8266/esp32 with LittleFS and SPIFFS support

Simple FTP Server and Client for the esp8266/esp32 with SPIFFS and LittleFS support.

I've modified a FTP Server from arduino/wifi shield to work with the esp8266 and the esp32. This allows you to FTP into your esp8266/esp32 and access/modify files and directories on the FS. SPIFFS's approach to directories is somewhat limited (everything is a file albeit it's name may contain '/'-es). LittleFS (which is not yet available for the esp32) however has full directory support. So with a FTP Server working on SPIFFS there will be no create/modify directory support but with LittleFS there is! The code ist tested it with command line ftp and Filezilla.

The FTP Client is pretty much straight forward. It can upload (put, STOR) a file to a FTP Server or download (get, RETR) a file from a FTP Server. Both ways can be done blocking or non-blocking.

This library was tested against the 2.7.1 version of the esp8266 Arduino core library and the 1.0.4 version of the esp32 Arduino core.

Select the desired FS via the contructor

#include <FTPServer.h>
#include <LittleFS.h>

FTPServer ftpSrv(LittleFS); // construct with LittleFS
// or
FTPServer ftpSrv(SPIFFS);   // construct with SPIFFS if you need to for backward compatibility
ftpSrv.begin("username", "password");
Handle by calling frequently
ftpSrv.handleFTP(); // place this in e.g. loop()

Select the desired FS via the contructor

#include <FTPClient.h>
#include <LittleFS.h>

FTPClient ftpClient(LittleFS); // construct with LittleFS
// or
FTPClient ftpClient(SPIFFS);   // construct with SPIFFS if you need to for backward compatibility
Provide username, password, server, port...
// struct ServerInfo
// {
//     String login;
//     String password;
//     String servername;
//     uint16_t port;
// };

ServerInfo ftpServerInfo ("username", "password", "server_name_or_ip", 21);
ftpClient.begin(ftpServerInfo);
ftpClient.transfer("local_file_path", "remote_file_path", FTPClient::FTP_GET);  // get a file blocking
ftpClient.transfer("local_file_path", "remote_file_path", FTPClient::FTP_PUT_NONBLOCKING);  // put a file non-blocking
Handle non-blocking transfers by calling frequently
ftpClient.handleFTP(); // place this in e.g. loop()

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4