Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
JRoselló
Contributor
Contributor

SFTP multiple files using tFTPPut

I'm having problems in a job that aims to take different "xml" files from a local directory and send them to a SFTP server.

The problem is that when I run the job I don't get any kind of error. The TFTPPut component theoretically works fine but does not really send the files to the SFTP server. It is very strange because I don't get any permissions error, or that the files are not found.

Tried debugging the job but couldn't understand where the actual problem is.

  • The TFileList_2 component reads the files in the directory well, as I have added a tJava that prints the files and the directory path and displays them correctly.
  • The "If" link has the following condition:

!Relational.ISNULL((((String)globalMap.get("tFileList_2_CURRENT_FILE"))))

  • Finally I use the tFTPPut component to send the files from the local directory to the SFTP server (using the connections of the tFTPConnection_1 element). Overwrite option is chosen. Moreover, the "FileMask" used is "*_ACA.xml" because all the files end like it.
  • I have added a Tjava after the tFTPPut component with the following print:

1)System.out.println((((String)globalMap.get("tFTPPut_2_CURRENT_STATUS")));

2)System.out.println(((String)globalMap.get("tFTPPut_2_TRANSFER_MESSAGES")));

3)System.out.println((((String)globalMap.get("tFTPPut_2_ERROR_MESSAGE"))));

I get this answers for this 3 prints:

1) No file transfered.

2) 50 files have been uploaded.

3)/public/CicleAigua/ATLL/ATLL_LIMS_in/*_ACA.xml (where there is the path of the SFTPServer / Filemask

Thanks in advance for any kind of help and let me know if more information is required for this.

Job Capture

0695b00000PLDIeAAP.png

tFTPPut component

0695b00000PLDItAAP.png

Labels (3)
2 Replies
Anonymous
Not applicable

Hi

You are using tFileList to iterate each file, so you should set the current file name in the FileMask field of tFTPPut2,

(String)globalMap.get("tFileList_1_CURRENT_FILE")

and change the job to:

...tFileList--iterate--tFTPPUT2.

use iterate link instead of runIf, otherwise, it will only put the last file.

 

If you don't use tFileList in the job, just set the filemask as "*_ACA.xml" to match all files, check the 'Use Perl Regex....' box.

 

Regards

Shong

JRoselló
Contributor
Contributor
Author

Hi,

 

As you said, I've changed the FileMask field of the tFTPPut2 with the current file name (String)globalMap.get("tFileList_1_CURRENT_FILE"). I've added to an "Iterate" between the tFileList_1 and tFTPPut_2.

 

The problem is almost solved, but I still have a problem. Some of the file names contain the character "(" and ")". Because of this, in the iteration, the variable (String)globalMap.get("tFileList_1_CURRENT_FILE") doesn't get the name right and fails. I get the error "No matches found for (the name of the file containing parentheses). 

 

Do you know how I could avoid the issue of this type of character in filenames?

 

Thanks in advance for any kind of help and let me know if more information is required for this.

 

Job capture:

 

0695b00000PLSAGAA5.pngtFTPPut component:

 

0695b00000PLSAQAA5.png