Process File Transfer

You can extend TeleFinder by scripting an action to take place after BBS File Transfers complete.

The action is defined by any application named "ProcessFileTransfer" in the same folder as TeleFinder Server. Whenever a file transfer completes, TeleFinder Server looks for a program called "ProcessFileTransfer" in its folder, opens it if necessary, then sends it the "Process File Transfer" event. This event is identical to the event that TeleFinder Server uses to create entries in the File Transfer Log window.

The ProcessFileTransfer program can be a compiled application, or an AppleScript saved as application. When using AppleScript, save the script with the following properties.

  • Kind: Application

    This is necessary since User Manager can only send the "Process New User" event to other applications.

  • Stay Open checked.

    This option increases performance by keeping the applet in memory ready to accept events from TeleFinder Server.

  • Never Show Startup Screen checked.

    This is necessary so that the applet can run without user interaction. Otherwise, the applet will open a startup screen when it is launched, preventing it from accepting the "Process New User" event. from TeleFinder Server.

 

Event Variables

The Process File Transfer event has the following properties.

  • Event Class (TFfl)
  • Event ID (tadf)

The Process File Transfer event contains the following parameters

  • User Name (tusr) the name (login id) of the user as text.
  • Node Name (tbbs) the name of the BBS Node that the user is logged in to as text.
  • File Spec (tfss) the name and location of the file that was transferred as a MacOS alias.
  • Transfer Code (txcd) the completion code of the file transfer as a number.
  • Elapsed Time (tept) the elapsed time of the transfer in seconds as a number.
  • Retransmits (trtx) the total retransmits to correct errors during the transfer as a number.
  • Bytes Sent (tsnt) the total bytes sent during the transfer as a number.
  • File Size (tfsz) the size of the file as a number.
  • Connect BPS (tbps) the connection speed in bits per second reported by the modem as a number.
  • Throughput (ttrp) the speed of the transfer in in characters per second as a number.
  • DateTime Complete (tcmp) the Date and Time that the transfer completed as a MacOS Time as a number ( 32 bit ).
  • Is DOS File (tdos) a number indicating if the transfer was from a PC running DOS or Windows, or from a Macintosh. The value is 1 for PC systems, 0 for MacOS systems.

     

Sample

You can find a sample script in the TeleFinder Server folder. By default the sample script is inactive because it is named "(ProcessFileTransfer)". To activate the script rename it to "ProcessFileTransfer" by removing the parenthesis from the file name.

The sample script is no more than a "shell" that you can use as a starting point in creating your own useful script. The sample parses the Process File Transfer event into individual variables then creates code blocks to handle the various completion codes. You would add your own scripting commands into the code blocks as necessary.

 

Complete Codes

TeleFinder provides the following completion codes to indicate the success or failure of each file transfer.

  • kLogMailReceived = 1 user sent email
  • kLogPostToTopic = 2 user posted to a conference
  • kLogCreateTopic = 3 user created a conference
  • kLogXMRcvSuccess = 4 server received file
  • kLogZMRcvSuccess = 5 server received file
  • kLogXMSendSuccess = 6 server sent file
  • kLogZMSendSuccess = 7 server sent file
  • kLogXMCancel = 8 xmodem cancel
  • kLogZMCancel = 9 zmodem cancel
  • kLogBGSendSuccess = 10 server sent file
  • kLogBGRcvSuccess = 11 server received file
  • kLogBGCancel = 12 background cancel