Modifying FTP scripts to put or get the file based on a certain time such as current date.

Modifying FTP scripts to put or get the file based on a certain time such as current date.

book

Article ID: KB0090810

calendar_today

Updated On:

Products Versions
TIBCO BusinessConnect -
Not Applicable -

Description

Resolution:
Description:
============
Modifying FTP scripts do a putCmd() or getCmd() rather than using file masking to append the files with custom names using date, etc.

Environment:
==========
BusinessConnect all versions

Resolution:
=========

Use the underlying Java functions to build a mask to scan for dates in file names.  As an example, here is a ECMAScrpt code snippet to show how to get  a file with a current date :

                      var z = new Date();
          var Day = parseInt(z.getDate());
                      var month = z.getMonth();
                      var year = z.getFullYear();
                      var k =  Day;
                      k = k+"-"+month+"-"+year+".txt";

K can be passed as a argument to the executeMgetCmd(java.lang.String filename) to retrieve the file with a  custom name.  An example snippet below:
  
     var reply = ftpClient.connect();
     reply = ftpClient.executeMgetCmd(k);
  
It would retrieve the files with names like 15-2-2013.txt.

Issue/Introduction

Modifying FTP scripts to put or get the file based on a certain time such as current date.