Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2300

Re: PI 7.3: routing .jpg files using SFTP Adapter module

$
0
0

Hi Peter,

 

Just looking at your code and also the whole example from the blog. Can you output the value of Filename to the audit log? Is it a path to a directory or a path to a file? Based on this condition I would say it's a path to a specific file:

 

(Filename!=null&& Filename.endsWith(".jpeg")||Filename.endsWith(".JPEG")||                                         

Filename.endsWith(".jpg")||Filename.endsWith(".JPG")){

 

 

This would explain why you only have 1 value in the variable 'list'. You may need to use string manipulation to derive the directory of the file (or java.io.File) and then re-init the variable 'list' by calling this statement before the 'for' loop:

 

list = sftpChannel.ls(PathToDirectory); 


Then inside the 'for' loop have some condition to only process the files you want to attach i.e JPEG/JPG


Other than that, I would also re-init the Payload object inside the 'for' loop to be safe.

payload = msg.createPayload();


Anyway, you're close. If I had known about it I too would use the Adapter Module suggested by Eng Swee to save you having to introduce a mapping


Regards,

Nick


Viewing all articles
Browse latest Browse all 2300

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>