on 08-05-2016 7:50 AM
Hi Guys,
How read the attachment extension name through mail Adapter. Working on SAP PI 7.31
In my scenario we will receive the .xlxs file or PDF.
I need to route to different mapping depends upon the extension of the file.
Do we need to create the new module or standard modules available?
can you share me your inputs on this.
Regards,
Praveen
Hi Praveen!
As far as I know you can't get payload name in mapping using UDF, only attachment id.
But you can get attachment name in adapter module by using Payload class for getting attachment name.
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
You can get the name with the below udf
InputAttachments inputAttachments = globalContainer.getInputAttachments();
System.err.println("Starts here");
System.err.println(inputAttachments.areAttachmentsAvailable());
Collection<String> attachements = inputAttachments.getAllContentIds(true);
System.err.println("size of attachment list is " +attachements.size() );
int i=0;
for (Iterator iterator = attachements.iterator();iterator.hasNext();) {
String array_element =(String) iterator.next();
System.err.println(" ids are "+ i++ +" value is"+ array_element);
Attachment attachment =inputAttachments.getAttachment(array_element);
String contentType= attachment.getContentType() ;
Regards,
Vikas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.