Search notes:

FTP

FTP stands for File Transfer Protocol.

command line

Interactive mode

With mput or mget multiple files can be sent using the star (*) on file names.
If ftp is in interactive mode, however, each file must be confirmed:
ftp> mput foo*.txt
mput foo-001.txt?
This can be turned of by going into non interactive mode. If it is using interactive mode or not can be queried with prompt:
ftp> prompt
Interactive mode off.
ftp> mput foo*.txt
local: foo-001 remote: foo-001.txt
…
Alternatively, ftp can be started with the -i command line flag to turn of interactive prompting.

Automatic login with password

See: ~/.netrc

Active vs passive mode

A FTP session consists of two TCP/IP connections, a data and a command connection (also referred to as data and command channel).
In both, active and passive mode, the command connection is initiated by the client.
With active mode, the data connection is initiated from the server to the client, with passive mode, the client not only starts the command connection, but also the data connection.
When the client is behind a firewall or the router is performing network address translation (NAT), passive mode should (must?) be used.

quote pasv

In a ftp session, passive mode can be entered with a quote command.
ftp> quote pasv
According to this and this Stackoverflow answers, quote pasv does not cause ftp.exe to enter passive mode if the value of Use PASV under the registry key HKEY_CURRENT_USER\Software\Microsoft\FTP is set to yes.

Accessing a ftp server from a web browser

Some (most?, all?) web browsers allow to access an ftp server with username and password with the following URL syntax where the username is separated from the password with colons and the password is separated from the ftp server name with a at-sign:
ftp://USERNAME:PASSWORD@ftp.server.xyz/path/to/resource
ff_ftp.bat is a cmd.exe batch file that creates such a URL from certain environment variables and then opens a Firefox with the assembled URL.

501 Syntax error in IP address

When I encountered 501 Syntax error in IP address for ls or dir, entering passive helped:
$ ftp $IPADDR
Connected to …
220 …
Name (…:rene):
331 User rene OK. Password required
Password:
230 OK. Current directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
501 Syntax error in IP address
ftp: bind: Address already in use
ftp> dir
501 Syntax error in IP address
ftp> pass
Passive mode on.
ftp> dir
227 Entering Passive Mode (…)
150 Accepted data connection
drwx--x---   10 rene       1301             4096 Mar 27 15:58 .
drwx--x---   10 rene       1301             4096 Mar 27 15:58 ..
…

TODO

Apparently, there is SFTP and FTPS (which are not the same thing).

See also

Perl module Net::FTP, TFTP - Trivial File Transfer Protocol
lftp
The Windows command line tool is ftp.exe.
A popular graphical FTP client (that also has a server edition) is FileZilla.
web
The PowerShell example that uploads a file to an ftp server
The registry key HKEY_CURRENT_USER\Software\Microsoft\FTP.

Index