
Chapter 12 – FTP Client
Command Line Interface and Application Examples for Multi-Tech Systems, Inc. IP Modules (S000368F) 122
Scenario 3 – Listing Directory Contents
This scenario describes how to list the contents of the specified directory of the FTP server:
• With Automatic Authentication enabled by specifying all authentication details: IP address of the device, valid
login name, valid password, and valid account password.
• Data connection in ACTIVE mode.
• When the user does not specify the directory name in the command line with the –d option, and an entry for
the default directory name does not exist in the configuration, the user is prompted for the directory name.
(Setting the default configuration is explained in the later section).
Description
The IP module establishes a control connection, automatically checks for the configured
values, and logs into the FTP server. If successfully logged in, it sends a message and
prompts the host device to enter the remote directory, the contents of which are then
displayed as follows:
Connected
Remote directory: <CR> or <Directory-Path>
If the Host simply enters <CR> without specifying the directory, then the contents of the
present working directory are listed. If the complete path of the directory is given, then the
contents of that directory are listed.
By default the data connection is in active mode. The client sets the data transfer mode as
‘ASCII’ to receive the list of contents of the directory.
If –m option is specified, it prompts the user for the next transaction or to quit. If the user
selects to do another transaction, then he is prompted to enter the directory again. In this
case, the directory entered for the previous transaction will not be considered.
Note: If '-p' option is specified in the command, the data connection will be in passive mode.
Configuration
set FTP machine <ip-address/host-name> login <user-name> password <passwd> account
<passwd>
Command
ftp -l [-d <directory>] [-p][-m] ip-address
Result Response
OK: FTP session closed
Scenario 4 – Listing Directory Contents
This scenario describes how to list the contents of the specified directory of the FTP server:
• With Automatic Authentication enabled by specifying all authentication details: IP address of the device and
valid login name.
• Data connection in ACTIVE mode.
• If an entry for the default directory name does exist in the configuration, the user is not prompted for the
directory name. The contents of the configured directory are automatically listed. (<directory-name> may be
the path name with respect to the ftp root).
Description
The IP module establishes a control connection, automatically checks for the configured
values, and logs into the FTP server.
If the user is a valid user, the host device is prompted to enter the Password as follows:
Password: ***<cr>
If successfully logged in, the module sends a message as follows and prompts the host
device to enter the remote directory, the contents of which are then displayed as follows:
Connected
Remote directory: <cr> or <Directory-Path>
If the Host simply enters <CR> without specifying the directory, then the contents of the
present working directory are listed. If the complete path of the directory is given, then the
contents of that directory are listed.
By default the data connection is in active mode. The client sets the data transfer mode as
‘ASCII’ to receive the list of contents of the directory.
If –m option is specified, it prompts the user for the next transaction or to quit. If the user
selects to do another transaction, then he is prompted to enter the directory again. In this
case, the directory entered for the previous transaction will not be considered.
Note: If '-p' option is specified in the command, the data connection will be in passive mode
Configuration
set FTP machine <ip-address/host-name> login <user-name>
Command
ftp -l {-d <directory>] [-p] [-m] ip-address
Result Response
OK: FTP session closed
Comentarios a estos manuales