A FTP-Client for the ESP32
- The main purpose of this library was to upload pictures from ESP32-CAM to a website making the picture available on a http url, as seen here https://github.com/ldab/ESP32-CAM-Picture-Sharing, making it usuable on
Blynk
or on your webiste.
[![Add New Feature (Uplaod File from SPIFFS)]
- SPIFFS configuration :
- Documentation about filestream
- https://github.com/espressif/arduino-esp32/blob/master/libraries/FS/src/FS.cpp
- https://github.com/espressif/arduino-esp32/blob/master/libraries/FS/src/FS.h
- List Dir contents test with different serves;
- Implement
FEAT
in order to choose which mode to list dir... - Implement download;
-
The idea behind this project is to
upload
the picture via FTP making it available on an URL something like:www.mysite.com/my_picture.jpg
-
This way you don't need to overload the ESP32, your network remains secure, not open to the world, no port forwarding.
-
For this example I uploaded the GitHub Octocat to my 000Webhost hosted webiste, the file is avalable under:
https://my_user.000webhostapp.com/gallery_gen/XxXxXxXx.jpg
- I was only able to download files up to ~90KB, as I can't see any usage for that, I did not spend extra time, as it's partially working.
- A new example under download_file.ino has been added;
ESP.getMaxAllocHeap()
returned limited amount of free memory, therefore the buffer can't hold the entire downloaded file.- For this reason I have implemented the last argument of
DownloadFile(const char * filename, unsigned char * buf, size_t length, bool printUART )
which will print the buffer directly to the UART; - If required, SPIFFS can be used to save the file.
- For this reason I have implemented the last argument of
- For the uploading example we will use the GitHub Octocat, which binary file is here:
- Originally forked from https://github.com/blackcodetavern/ESP32_FTPClient