Using STRTCPFTP command to Transfer a file from a remote host in IBM i (AS400) |
In this article we discuss about the FTP to transfer file across a TCP/IP network. Generally we need two connections to perform FTP.
- Control Connection: It is used to send subcommands from the client to server and receive response to those subcommands from the server to client. The Client starts the FTP commands to the FTP server.
- Data Connection:It is used to transfer actual files. To transfer the files there are some pre-requisites and things to know prior to FTP.
- Required a user id on both IBM i machines.
- IBM TCP/IP Connectivity Utilities for IBM i (5770-TC1)
- FTP server configured
- Must know host name of the remote system
- User id and password of the remote system
- File to be transferred
- File Location
- File Format (ASCII or Binary)
Steps to FTP
- Start your FTP client session. Type STRTCPFTP on IBM i command line and press Enter.
- Specify the name of the remote system to which you need to send the file. Here we use loopback instead of remote ip or domain name
- Specify User Id of remote system
- Specify password of remote system
- Specify file type, ASCII or BINARY. Default type is ASCII.
- Now, Request the file transfer from the remote server to the client system.
- Finally, once FTP is finished then EXIT from FTP session.
Start TCP/IP File Transfer (STRTCPFTP) Type choices, press Enter. Remote system . . . . . . . . . RMTSYS Internet address . . . . . . . . INTNETADR Coded character set identifier CCSID *DFT Port . . . . . . . . . . . . . . PORT *DFT Secure connection . . . . . . . SECCNN *DFT
Start TCP/IP File Transfer (STRTCPFTP) Type choices, press Enter. Remote system . . . . . . . . . RMTSYSloopback Internet address . . . . . . . . INTNETADR Coded character set identifier CCSID *DFT Port . . . . . . . . . . . . . . PORT *DFT Secure connection . . . . . . . SECCNN *DFT
Enter login ID (easyclass): ===>
Enter password ===>
Enter an FTP subcommand. ===> BIN
Enter an FTP subcommand. ===> GET <Fully qualified from-location7> <fully qualified to-location>
Enter an FTP subcommand. ===> QUIT