Renaming a file with XCOM GATEWAY prior to onward transfer
search cancel

Renaming a file with XCOM GATEWAY prior to onward transfer

book

Article ID: 201546

calendar_today

Updated On:

Products

XCOM Data Transport XCOM Data Transport - Windows XCOM Data Transport - Linux PC XCOM - SUPPORT

Issue/Introduction

What would be the procedure to change or replace a file name prior to performing the onward transfer with the CA XCOM Gateway?

 

Environment

Release : 12.0

Component : CA XCOM DATA TRANSPORT GATEWAY FOR WINDOWS

Resolution

Regarding the remote file renaming, you can make use of XCOM PRE scripts in XCOM to achieve this easily.  A sample pre-processing script is installed in the %XCOM_HOME% directory and to use this script, you need to configure the XPRECMD Global parameter in xcom.glb file with the script file path. 

It will look something like below: 

XPRECMD=%XCOM_HOME%\xcompre.bat

You need to customize the xcompre.bat to modify the remote file names based on local file names. Here, the local file name will be in the format of "/policy/filename"
 

For example: If you uploaded a file "client" to policy "accounts", then the Local file name will be in the form "/accounts/client" in the onward transfer. 

To modify the remote file names based on local files, you need to use the following sample code snippet in your xcompre.bat file

:XCOMPRE_LOCALecho %file% | findstr "\/*\/client1"if %ERRORLEVEL% NEQ 0 GOTO XCOMPRE_END%xcomqm% -p%local_reqno% REMOTE_FILE=<file name>GOTO XCOMPRE_END

Note:  You can ignore or remove any other code lines available under ":XCOMPRE_LOCAL"  in the original script. This is just an example of how to use it. 

Note: You need to duplicate these 4 lines as many times as you need to replace the various remote file names based on incoming file names. 

Please remember to remove the pause statement at the end under ":XCOMPRE_END". It will look like below after the update. 

:XCOMPRE_END        if /%use_echo%/ == /YES/ echo XCOMPRE_END        rem pause        exit