Using the Generic File Receiver Application

[This is preliminary documentation and subject to change.]

The Generic File Receiver is designed to capture a file or files that have been broadcast. The Generic File Receiver may also optionally spawn a second application, passing the file names of the received file or files to it, or attempt to launch the files themselves (using the file associations for the Microsoft® Windows® family of operating systems).

The Generic File Receiver expects to find the /J, /IPD, and /IPL options in the command line passed to it by the Task Scheduler, as described in Receiver Application Command Line.

In addition, the /s option may be used with the Generic File Receiver to spawn the received file. The /s string may be supplied in the Parameters string returned by IBroadcastFilter::GetDisposition. Without the /s option, the Generic File Receiver simply receives the file and saves it in the specified working directory.

For example, to launch the file received, the command line is:

GenRecv /J "BFTP_JOB_234" /IPD 224.45.38.92:3256 /IPL 192.78.38.92 /s
 

(The preceding example assumes that the Generic File Receiver has been named Genrecv.exe; in fact it has not yet been named.)

Any text on the command line of the Generic File Receiver beyond the /J, /IPD, /IPL, and /s options is treated as a new command line, with the name of the received file appended at the end of the command line arguments. For example, the command line:

GenRecv /J "BFTP_JOB_234" /IPD 224.45.38.92:3256 /IPL 192.78.38.92 Excel.exe
 

causes the Generic File Receiver to launch Microsoft® Excel with the file received. Assuming that the transmitted file was Sample.xls, this results in the following command line being launched:

Excel.exe Sample.xls
 

If a /s option appears with other arguments beyond the /J, /IPD, and /IPL on the command line, the /s are presented along with the other arguments as the new command line, rather than spawning the received file. For example:

GenRecv /J "BFTP_JOB_234" /IPD 224.45.38.92:3256 /IPL 192.78.38.92  Excel.exe /s
 

launches the following (assuming that the transmitted file was Sample.xls)

Excel.exe /s sample.xls
 

(In this case, /s is assumed to be a parameter intended for Excel.exe.)

If the Generic File Receiver runs successfully, it deletes its job from the Task Scheduler, even if there are later scheduled broadcasts (if there are no later scheduled broadcasts, the JOB_FLAG_DELETE_WHEN_DONE value causes the job to be deleted automatically, whether it succeeded or failed). If the Generic File Receiver fails and IJob::GetNextRunTime returns the value S_OK, then the job is left in the scheduler to run again.