Host Programs that Initiate File Transfers with Reflection

  • 7021480
  • 30-Mar-2000
  • 26-Oct-2020

Environment

Reflection Desktop version 16.0 and higher
Reflection Desktop for Unix and OpenVMS version 16.0 and higher
Reflection Desktop Pro version 16.0 and higher
Reflection 2014
Reflection for UNIX and OpenVMS 2014
Reflection for UNIX and OpenVMS 2011
Reflection for UNIX and OpenVMS version 14.x
Reflection Standard Suite 2011
Reflection for HP version 14.x
Reflection for ReGIS Graphics version 14.x

Situation

This technical note explains the principles of writing a host program to initiate file transfers between a host computer and Reflection.

This note supplements KB 7021476, which gives a general overview of host programs that send commands to Reflection.

Resolution

Transferring Files with a Host Program

Many host programs involve a transfer of files between Reflection and the host. To transfer files, Reflection and the host must use the same file transfer protocol.

Reflection comes with several host file transfer programs that enable files to be transferred to and from the host computer. This protocol includes features such as wildcard transfer in both directions, Huffman data compression, sliding windows, and network-speed file transfer.

The file transfer program for your host is usually uploaded by the system administrator when Reflection is installed.

When Reflection receives a command to transfer a file, it first checks to make sure the file exists. If the file exists, Reflection returns a host startup sequence instructing the host to start the appropriate file transfer program. With the file transfer program running, the host can transfer files to or from Reflection.

Completion Codes and File Transfers

Building a successful host program requires careful utilization of completion codes to make sure all meaningful errors are communicated back to the host.

A host-initiated file transfer should involve the following steps:

  1. The host program sends a Reflection Basic (RB) or Reflection Command Language (RCL) command to Reflection requesting a file transfer. Note: You cannot send commands to Reflection from a host program using Visual Basic for Applications (VBA).

See KB 7021486 for information about executing Reflection Basic (RB) host-initiated commands using Microsoft Visual Basic for Applications (VBA).

  1. If the file exists, Reflection returns the host startup sequence to start the file transfer program on the host, and then proceeds to the next step. If the file does not exist, Reflection returns a completion code indicating the operation failed, and the host program aborts the transfer.
  2. Once the host transfer program successfully starts, the file is transferred.
  3. When the transfer is complete, Reflection returns a completion code indicating success. If the transfer was interrupted or could not be completed, Reflection returns a completion code indicating that the file transfer failed.

As you can see, there are two places where the host program waits for a reply from Reflection: first, to verify that the requested file exists, and second, to verify that the file was successfully transferred. Your host program must be written to handle Reflection’s reply at either of these points.

For details on specifying completion codes in RB, refer to KB 7021479; in RCL, refer to KB 7021478.

Sample Files

For information about how to obtain sample scripts, settings files, and macros for Reflection that describe and demonstrate Reflection product functionality, see KB 7021639.

You can use these sample files as a starting point in creating your own host programs, however, modifying the files requires knowledge of both the host programming language and Reflection's scripting languages. Consult your host documentation for information about writing programs for your host computer. For information about Reflection's scripting languages, refer to your Reflection documentation.

Troubleshooting Tips

If your host program cannot successfully transfer a file, try manually transferring the file with Reflection. If you cannot manually transfer the file, check the following:

  • The file transfer program on the host cannot be started or does not exist.
  • The file to be transferred does not exist in the specified location. Verify the location of the file on the PC or the host.

Consult your Reflection documentation for additional techniques to use when troubleshooting file transfers, including instructions for generating a file transfer log file for your host type.

For general troubleshooting tips related to host programs, see KB 7021476.

Contacting Micro Focus

If you are able to transfer the file manually, but the host program still does not work, contact Micro Focus Customer Support for further assistance, https://support.microfocus.com/contact/attachmate.html.

When you call, please have the following items on hand:

  • An event trace showing the interaction between Reflection and the host program. For instructions on generating an event trace, see KB 7021622.
  • A file transfer log file created when attempting to manually transfer the file with Reflection. The steps for creating a file transfer log file vary depending on your host type and are covered in your Reflection documentation.
  • The version number of the file transfer program on the host. See KB 7021587 for instructions on obtaining the version number.

Additional Information

Legacy KB ID

This document was originally published as Attachmate Technical Note 1280.