Author |
Message
|
elenzo |
Posted: Tue Oct 08, 2013 6:55 am Post subject: |
|
|
Acolyte
Joined: 22 Aug 2006 Posts: 53
|
I almost got it!
The problem was in line:
[/code] CREATE FIELD P2."Content-Type" TYPE NameValue VALUE 'application/octet-stream; name='
Code: |
The correct value for content-type is "image/jpeg".
Now the attachment come as image on my email!
The only thing missing is that the email shows the images and the html all together and not the image as separate attachments, because de images that i am sending are the client's logo and a separator bar and should be part of the email body, I guess i need to change something else on the MIME message and It would be working just fine |
|
|
Back to top |
|
 |
Jain |
Posted: Sun Mar 08, 2015 7:33 pm Post subject: |
|
|
 Novice
Joined: 11 Nov 2011 Posts: 21
|
I'm trying to attach a image in the email. for doing so i'm using file input node to get image from dir and using below code.
I'm getting attachment but its not supported by anny of the image viewer.
CREATE FIELD OutputRoot.MIME TYPE Name;
DECLARE M REFERENCE TO OutputRoot.MIME;
CREATE FIELD M."Content-Type" TYPE NameValue VALUE 'multipart/related; boundary=myBoundary';
CREATE FIELD M."Content-ID" TYPE NameValue VALUE 'new MIME document';
CREATE LASTCHILD OF M TYPE Name NAME 'Parts';
CREATE LASTCHILD OF M.Parts TYPE Name NAME 'Part';
-- First part:
-- Some code
-- Second part:
CREATE FIELD P2."Content-Type" TYPE NameValue VALUE 'image/jpeg; charset=utf-8;';
CREATE FIELD P2."Content-Transfer-Encoding" TYPE NameValue VALUE '64bit';
CREATE LASTCHILD OF P2 TYPE Name NAME 'Data';
CREATE LASTCHILD OF P2.Data DOMAIN('BLOB') PARSE(InputRoot.MQRFH2.usr.Image); |
|
Back to top |
|
 |
Jain |
Posted: Sun Mar 08, 2015 8:43 pm Post subject: |
|
|
 Novice
Joined: 11 Nov 2011 Posts: 21
|
Jain wrote: |
I also tried below code
-- First part:
-- Some code
-- Second part:
CREATE FIELD P2."Content-Type" TYPE NameValue VALUE 'image/jpeg; ';
CREATE FIELD P2."Content-Transfer-Encoding" TYPE NameValue VALUE 'base64';
CREATE LASTCHILD OF P2 TYPE Name NAME 'Data';
CREATE LASTCHILD OF P2.Data DOMAIN('BLOB') PARSE(CAST(InputRoot.MQRFH2.usr.Image AS BLOB CCSID 1208)); |
|
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Mar 09, 2015 4:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you thought about not specifying a CCSID in the cast? A JPEG is not text...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Mar 09, 2015 4:23 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I'm confused.
Is this an entirely new question at the end of a very long thread, with many sections and posts that are irrelevant to the question being asked and significantly older? |
|
Back to top |
|
 |
Jain |
Posted: Mon Mar 09, 2015 4:34 am Post subject: |
|
|
 Novice
Joined: 11 Nov 2011 Posts: 21
|
fjb_saper wrote: |
Have you thought about not specifying a CCSID in the cast? A JPEG is not text...  |
Can you help me to know CCSID for jpeg image file? |
|
Back to top |
|
 |
Jain |
Posted: Mon Mar 09, 2015 4:36 am Post subject: |
|
|
 Novice
Joined: 11 Nov 2011 Posts: 21
|
mqjeff wrote: |
I'm confused.
Is this an entirely new question at the end of a very long thread, with many sections and posts that are irrelevant to the question being asked and significantly older? |
I contained the same thread because the initial user was having similar kind of issue while sending image file in the email. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Mar 09, 2015 7:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Jain wrote: |
fjb_saper wrote: |
Have you thought about not specifying a CCSID in the cast? A JPEG is not text...  |
Can you help me to know CCSID for jpeg image file? |
CCSID stands for Coded Character Set ID.
You can use a CCSID only if the transformation is from a string to a byte array and vice versa.
What you are really looking at is the transformation from a byte array to a 64 bit encoded byte array. This 64 bit encoded can be represented as ascii text.
However I would not want to transform that text to any other CCSID as this might break reconstituting the image.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|