
Chapter 12 – FTP Client
Command Line Interface and Application Examples for Multi-Tech Systems, Inc. IP Modules (S000368F) 139
Scenario 23 – Receiving a File from the FTP
Server
This scenario describes the receiving of a file from the FTP server:
• With Automatic Authentication enabled by specifying a few authentication details: IP address of the device
and a valid login name
• Data connection in ACTIVE mode.
• If an entry for the default file name does exist in the configuration, the user is not prompted for the file name.
If the directory is also configured using set command, the directory-name is appended to the filename.
(<directory-name/file-name> may be the path name with respect to the ftp root.)
Description
The IP module establishes a control connection to the specified FTP server, automatically
checks for the configured values, and logs into the FTP server. If the user is a valid user, the
IP module prompts the host device to enter the Password shown here:
Password: **** <CR>
If successfully logged in, the IP module sends a message and prompts the host device to
enter a Filename, and then it sends a message as below:
Connected
Filename: filename <CR>
size = <filesize from server>
Press <CR> to receive file
<CR>
------ File Transfer ----
When the complete file is received, the FTP session responds with OK.
By default the data connection is in active mode. The client sets the data transfer mode as
‘BINARY/IMAGE’ during the file transfer.
If the –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 Filename again. In
this case, the filename entered for the previous transaction will not be considered. The user
should specify the whole path. The directory specified using “Set ftp directory xxx” or the
filename specified using “set ftp filename xxx” or filesize specified using “set ftp filesize xxx”
will not be considered.
Note: If '-p' is specified in the command, the data connection will be in passive mode.
Configuration
set ftp machine <ip-address/host-name> login <user-name>
set ftp filename <file-name>
set ftp directory <directory-name>
Command
ftp -r [-d <directory>] [-n <filename>] [-p] [-m] <ip-address/host-name>
Result Response
OK: FTP session closed
How to Close or Abort the FTP Session
The host can abort the FTP session by issuing Ctrl+CDZ at any given time.
How to Abort a File Transfer Session
The host can abort the file transfer by issuing Ctrl+CDZ with a delay of 3 seconds.
The file into which data was written will be deleted by the client, and the data connection will be closed.
Note: How to Type the Abort Command
Hold down the Ctrl key and type the letters CDZ all in a row without any spaces.
About Read and Store
The serial device has to read and store the data received. It has to implement timeout mechanisms to come out
in cases where the network is prone to errors.
Comentarios a estos manuales