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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
chafer
Contributor
Contributor

Iterate jpeg files from a folder and convert to base64

We are able to use the exchange module tBase64 to convert a 'single' image to base64 text. The conversion fails at tBase64 when we run it using the "tFileList" to iterate through multiple jpeg files (in this image below, we are using one image).

 

Has anyone found a solution that converts multiple jpeg images to base64 text files - with or without tBase64 module? 

 

For the Job that fails: 

tFileList mask is "*.jpg"

Using 'tFileInputRaw' to 'Read the file as a string' 

Filename value: ((String)globalMap.get("tFileList_2_CURRENT_FILE"))  

 

0683p000009M0L3.jpg

 

-----------  Error ----------

java.io.FileNotFoundException: File 'chafer_profile.jpg' does not exist
Exception in component tBase64_4
java.lang.NullPointerException
at hafer_sandbox.case_base64_0_1.case_BASE64.tFileList_3Process(case_BASE64.java:2236)
at hafer_sandbox.case_base64_0_1.case_BASE64.tFileInputRaw_4Process(case_BASE64.java:1361)
at hafer_sandbox.case_base64_0_1.case_BASE64.runJobInTOS(case_BASE64.java:6330)
at hafer_sandbox.case_base64_0_1.case_BASE64.main(case_BASE64.java:6144)
[ERROR]: hafer_sandbox.case_base64_0_1.case_BASE64 - tFileInputRaw_1 - File 'chafer_profile.jpg' does not exist
[FATAL]: hafer_sandbox.case_base64_0_1.case_BASE64 - tBase64_4 null

---------------------------------

Labels (4)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Use tFileList_2_CURRENT_FILEPATH instead of tFileList_2_CURRENT_FILE

View solution in original post

3 Replies
TRF
Champion II
Champion II

Use tFileList_2_CURRENT_FILEPATH instead of tFileList_2_CURRENT_FILE

chafer
Contributor
Contributor
Author

That works. Thank you 

 

 

milver
Contributor
Contributor

I can't run, what am I doing wrong?

 

0693p00000C7ymJAAR.png