This example will upload a received file to an FTP site, and should be called from a worker box initiated as part of post-receive processing.
![]() | CopiaFacts now includes a comprehensive set of scripts to handle post-receive and post-transmit notifications. For most applications you should use the standard scripts in preference to this example. |
The example assumes that the post-receive infobox has called $var_def_copy PR to copy the post-receive variables to the worker-box. It makes use of the FTPUPLOAD utility.
; UPLOAD.IIF
$type query
$run "FTPupload.exe -p ftp://uploader:copia@@ftp.copia.com/files/ ""@PR%FAXPATH"""
$next_box CHECKUPLOAD ; test upload result
; CHECKUPLOAD.IIF
$type decision
; @FFRESULT has errorlevel from $run
$if @FFRESULT $ne 0
$set_var NOTIFY_MESSAGE "Failure (@FFRESULT) to upload FTP file @PR%FAXFILE"
$set_var FS_PREFAIL 201
$endif
$chain