Scenario: Transfer a file from a remote host

To transfer a file to a test server, use basic File Transfer Protocol (FTP) to send the file to the remote host.

Situation

Suppose that a colleague developed Java™ files on a remote server. As a system engineer, you need to transfer the example.jar file from the remote server to your local test server. The client and the server are both an iSeries™ using i5/OS™ FTP.

Objectives

Use FTP to transfer the file across a TCP/IP network.

Details

To transfer the file, two connections are used: the control connection and the data connection. The control connection is used to send subcommands from the client to the server and receive responses to those commands from the server to the client. The client initiates FTP commands to the FTP server. The data connection is used to transfer the actual files. Both the client and the server interface with the i5/OS file system.

To transfer files, you need a user ID on both systems. You also need the following system requirements:

To transfer files, you also need to know the following information:

Configuration tasks

You must complete each of these tasks to perform a simple file transfer:

Note: You can also transfer files automatically by using FTP as a batch job.
  1. Start your FTP client session. For this scenario: In the iSeries character-based interface, type STRTCPFTP and press Enter.
  2. Specify the name of the remote system to which you want to send the file.

    For this scenario: theirco.com

  3. Tell the remote system your user name for the remote server. For this scenario:
    Enter login ID (yourid):  
    ===>yourid
  4. Tell the remote system your password for the remote server. For this scenario:
    Enter password: 
    ===>yourpassword            
  5. Locate the directory on the TheirCo server from which you want to transfer the file. For this scenario: ===>cd /qibm/userdata/os400/dirserv/usrtools/windows
  6. Navigate to the directory on the local server to which you want to transfer the file. For this scenario: ===>lcd /qibm/userdata/os400/dirserv/usrtools/windows
  7. Specify file type, ASCII or BINARY. Default file type is ASCII. For a .jar file, you must switch the file transfer type to binary. For this scenario: ===> binary
  8. Request a file transfer from the remote server system to the client system. For this scenario: ===> get example.jar
  9. When finished, Exit from FTP.

    For this scenario: ===> QUIT

Related tasks
Transfer files with File Transfer Protocol
Related reference
Run File Transfer Protocol in unattended mode using a batch job
Start and stop a client session
ASCII (Change File Type to ASCII)
BINARY (Set Transfer Type to Image)