|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Reading mail attachment's filename. |
« View previous topic :: View next topic » |
Author |
Message
|
grasher134 |
Posted: Mon Dec 22, 2014 12:31 am Post subject: Reading mail attachment's filename. |
|
|
Acolyte
Joined: 22 Oct 2014 Posts: 62
|
Hello.
I have a simple message flow EmailInput - Compute - FileOutput.
It works, but I have difficulties with extracting full filename from attachment. I do it like this now:
Code: |
InputRoot.MIME.Parts.Part[2]."Content-Type" |
But then I have to parse it like text
Code: |
SET posbegin = POSITION('name' IN Contents);
SET posbegin = posbegin + 5;
SET FileName = SUBSTRING(Contents FROM posbegin FOR 7);
|
I know it is a very bad idea, but I have not found any other field, except of "Content-Type", that contains filename.
I sense, that it's a very trivial question. But I'm stuck with it
P.S. I heard there was some way to see the whole tree coming through such nodes as FileInput or EmailInput, but I didn't find it. |
|
Back to top |
|
 |
Simbu |
Posted: Mon Dec 22, 2014 12:54 am Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
Hi,
The field Content-Disposition will have the filename of the attachment but still you need to use String function.
Quote: |
Content-Disposition: attachment;filename="test.txt" |
|
|
Back to top |
|
 |
mqjeff |
Posted: Mon Dec 22, 2014 6:37 am Post subject: Re: Reading mail attachment's filename. |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
grasher134 wrote: |
P.S. I heard there was some way to see the whole tree coming through such nodes as FileInput or EmailInput, but I didn't find it |
This is the Trace node. Wire one in after the EmailInput, configure a destination for it to write to, and then specify a pattern of ${Root} |
|
Back to top |
|
 |
grasher134 |
Posted: Wed Dec 24, 2014 5:51 am Post subject: |
|
|
Acolyte
Joined: 22 Oct 2014 Posts: 62
|
Thank you all for your help.
So the only way - is to parse text. And it doesn't suit me, because different mail servers can write it in different ways. This error caused me to look for another decision.
About Trace node.. I tried it, wanted to write to file, but it didn't do anything.
It was like EMailInput - TraceNode - ComputeNode - ...
Is there any sample, where I can look at it? |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|