nodeMCU filezilla ESP8266FtpServer.h small files problem [solved]

Just ran into a problem uploading files using filezilla to SPIFFS with the ESP8266FtpServer library. It all working happily until I started to transfer my website files, e.g. index.html or my.css. Each time I tried I got a “target file already exists” and trying to overwrite just put me in a loop. Net result a 0B file was created in SPIFFS - not what I wanted!

Eventually tracked the problem down to file size, any file of less than about 2.5k would not transfer, anything over this would copy happily. I’ve solved my problem by padding out the relevant files with comments to get the file size above 2.5k, but have no idea what is causing the problem?

Attached screenshot is filezilla showing the problem.

Any ideas on what is causing the problem and a more elegant solution than the one I’ve adopted?

Have you tried using another ftp client than filezilla? The error you get from the server means the client failed to open a data connection within ten seconds. And I cannot find anything in the code that seems to have a relation to a 2.5kB size limit (or any other usage of the file size in that stage).

No, filezilla is the only ftp client I've installed, just had a look at what's available for linux and I'll give gFTP a try.

Edit - tried gFTP and it doesn't play with the nodemcu, would connect but couldn't display a file list (all the files in SPIFFS are of the form /filename.ext to mimic a root directory). This is what gFTP gave me:

Looking up 192.168.0.61
Trying 192.168.0.61:21
Connected to 192.168.0.61:21
220--- Welcome to FTP for ESP8266/ESP32 ---
220---   By David Paiva   ---
220 --   Version FTP-2017-10-18   --
USER esp8266
331 OK. Password required
PASS xxxx
230 OK.
SYST
500 Unknow command
TYPE I
200 TYPE is now 8-bit binary
CWD /
250 Ok. Current directory is /
PWD
257 "/" is your current directory
Loading directory listing / from server (LC_TIME=en_GB.UTF-8)
PASV
227 Entering Passive Mode (192,168,0,61,195,89).
LIST -aL
150 Accepted data connection
Warning: Cannot parse listing +r,s17
Warning: Cannot parse listing ,	format.txt
Warning: Cannot parse listing +r,s2513
Warning: Cannot parse listing ,	index-old.html
Warning: Cannot parse listing +r,s33075
Warning: Cannot parse listing ,	jquery.csv.js
Warning: Cannot parse listing +r,s2838
Warning: Cannot parse listing ,	test.csv
Warning: Cannot parse listing +r,s3078
Warning: Cannot parse listing ,	my.css
Warning: Cannot parse listing +r,s1119
Warning: Cannot parse listing ,	20190203L-WETHR02.bak
Warning: Cannot parse listing +r,s0
Warning: Cannot parse listing ,	20190203D-WETHR01.csv
Warning: Cannot parse listing +r,s2748
Warning: Cannot parse listing ,	index2.html
Warning: Cannot parse listing +r,s38078
Warning: Cannot parse listing ,	favicon.ico
Warning: Cannot parse listing +r,s2393
Warning: Cannot parse listing ,	20190204D-WETHR02.bak
Warning: Cannot parse listing +r,s152
Warning: Cannot parse listing ,	20190204L-WETHR02.bak
Warning: Cannot parse listing +r,s30
Warning: Cannot parse listing ,	20190205L-WETHR02.log
Warning: Cannot parse listing +r,s979
Warning: Cannot parse listing ,	20190205D-WETHR02.csv
226 13 matches total

Didn't have this problem with filezilla, so I'll continue looking at other linux FTP clients and/or see if there are any settings in Filezilla I can change.

No, filezilla is the only ftp client I've installed, just had a look at what's available for linux and I'll give gFTP a try.

Try the command line ftp client as it's much more basic than the GUI variants which expect a full fledged UNIX FTP server on the other end.

The output shows that the ESP8266 FTP server doesn't support extensions to the LIST command which gFTP simply expects. But nevertheless you should be able to transmit files with it, as these were only warnings.

ftp in a terminal worked, but had to invoke it as pftp so that it would work in passive mode. Just used it to transfer a 800 byte file. Running ftp would not give me a directory listing or much else, but once I used pftp, no problems.

Marking as solved although why I have the filezilla problem, still don't know. I also looked at the code and couldn't see anything obvious (not easy to read as it's a whole bunch of nested if statements). I now have a robust mechanism to FTP files onto SPIFFS.

Thanks for your input :slight_smile: