ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Zip file as email attachment

Post new topic  Reply to topic Goto page Previous  1, 2
 Zip file as email attachment « View previous topic :: View next topic » 
Author Message
Buzz Lightyear
PostPosted: Thu Jun 15, 2017 8:51 pm    Post subject: Reply with quote

Newbie

Joined: 29 May 2017
Posts: 9

The plot thickens !

The below code resulted in the BLOB being set to empty.
Code:
SET mimePart .Data.BLOB.BLOB = ASBITSTREAM(refFileSet.PackedData CCSID 1208 ENCODING 273);


Quote:

(0x01000000:Name):Part = (
(0x03000000:NameValue):Content-Type = 'application/zip; name=application-logs.zip' (CHARACTER)
(0x03000000:NameValue):Content-Transfer-Encoding = '8bit' (CHARACTER)
(0x01000000:Name ):Data = (
(0x01000000:Name):BLOB = ( ['none' : 0x11d49a530]
(0x03000000:NameValue):BLOB = X'' (BLOB)
)
)
)
)
)
)


A question here is why should we use ASBITSTREAM function when the variable contains a BLOB which is a byte array ?
One more interesting point in this is that if I open the zip (empty looking one) in notepad, I can see the zip entries (file names in clear text) interspersed within the binary data.

Will try out using Base64 encoding and will report my findings.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jun 15, 2017 9:01 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

If I remember correctly it has to do with encoding 8 bit vs 7 bit and UTF-8 settings. It is better to specify 64 bit encoding and do not forget to specify this also in MIME.

Hope it helps
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Buzz Lightyear
PostPosted: Thu Jun 15, 2017 9:16 pm    Post subject: Reply with quote

Newbie

Joined: 29 May 2017
Posts: 9

Houston, we have a touch down ! Using the Base64 encoding worked. I now have a valid zip file delivered in my inbox !

Code:

   CREATE FIELD mimePart."Content-Type" TYPE NameValue VALUE 'application/zip; name=application-logs.zip';
   CREATE FIELD mimePart."Content-Transfer-Encoding" TYPE NameValue VALUE 'base64';
            
   CREATE LASTCHILD OF mimePart TYPE Name NAME 'Data';
   CREATE LASTCHILD OF mimePart.Data DOMAIN('BLOB') PARSE(BASE64ENCODE(refFileSet.PackedData) CCSID 1208 ENCODING 273);



Thank you fjb_saper, mqjeff, Vitor ! I bow to thee !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Zip file as email attachment
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.