on 09-30-2013 9:52 AM
Hi All,
I have a requirement that SFTP adapter will pick two files ( One as a Main payload and other one as attachment through additional Files option)
Requirement: I need to read the attachment file name and send it via field.
Kindly help with the UDF code for the same.
Note : We are using PI7.31
Regards,
Mani
try the following code in the UDF
GlobalContainer globalContainer = container.getGlobalContainer();
InputAttachments inputAttachments = globalContainer.getInputAttachments();
String attachmentID = null;
try
{
if(inputAttachments.areAttachmentsAvailable())
{
Collection<String> CollectionIDs = inputAttachments.getAllContentIds(true);
Object[] arrayObj = CollectionIDs.toArray();
for(int i =0;i<arrayObj.length;i++)
{
attachmentID =(String)arrayObj[i]; // this should return the file name
}
}
catch (Exception e)
{
e.printStackTrace();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.