Transferring files using FTP client interactive mode

Interactive mode permits the z/TPF operator to interact with a remote server much like FTP clients on a Windows- or Linux- based platform. When you are using interactive mode, you establish a connection to a remote server and then perform operations on that session including setting transfer options, changing directories, listing files in a directory, creating new directories, and transferring files. Interactive mode is more practical than single command mode when you have multiple files to transfer. To use FTP client support in interactive mode, do the following:

  1. Optionally, define an FTP client profile that you will use when transferring files.
  2. Enter the ZFTPC CONNECT command, specifying the name of the FTP client profile, to connect to the remote server. If you do not specify an FTP client profile, the z/TPF system will use the TPFDEF FTP client profile. The response from this command includes an FTP session identifier (ID), which you must use for additional ZFTPC commands for this FTP session.
    Note: You can store the session ID in the FTPCUSE environment variable so that you do not have to specify it for all of the ZFTPC commands that follow the ZFTPC CONNECT command. Enter the ZFILE export command with the FTPCUSE parameter specified to store the session ID.
  3. Enter any of the ZFTPC commands that has a session ID to perform the desired operation; for example, enter the ZFTPC GET or ZFTPC PUT command, specifying the session ID that was returned in the previous step, for each file that you want to transfer to or from the remote server. You can also change transfer options between each file transfer.
    Note: You can specify either a fully qualified or relative path name for the file that is being transferred on the z/TPF system and for the remote server.
  4. When you have finished using the FTP session, enter one of the following commands to end the session:
    • ZFTPC BYE
    • ZFTPC DISCONNECT
    • ZFTPC EXIT
    • ZFTPC QUIT.
    Note: If a previously established FTP client session remains idle for more than 15 minutes, the z/TPF system automatically ends the session. However, remote servers might choose to end idle sessions in a shorter amount of time; this is implementation-specific.