Posted: Mon Oct 23, 2017 9:15 am Post subject: Generate file from BASE64encoded payload
Acolyte
Joined: 08 Apr 2007 Posts: 56
I have base64 encoded message of a pdf file. I need to generate the pdf file.
Following is the code I am using:
Code:
SET BLOB_Payload= BASE64DECODE(refBO.*:payLoad);
CREATE FIELD OutputRoot.Properties.ContentType TYPE NameValue VALUE 'application/xop+xml; charset=UTF-8; type="text/xml"';
SET OutputRoot.DFDL.UPLOADDELETE.record.field1=CAST(BLOB_Payload AS CHARACTER CCSID 819 ENCODING 546);
CCSID 1208 is throwing cast error.
The txt file is generating fine but complex file like pdf or image file are getting corrupted.
Please let me know where I am missing
Posted: Mon Oct 23, 2017 10:03 am Post subject: Re: Generate file from BASE64encoded payload
Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
ata_nitjsr wrote:
CCSID 1208 is throwing cast error.
So to be clear, the CAST statement fails when you use 1208 rather than 819? What is the exact text of the error?
ata_nitjsr wrote:
The txt file is generating fine but complex file like pdf or image file are getting corrupted.
How have you determined that?
ata_nitjsr wrote:
Please let me know where I am missing
I don't see where in the code you use something other than "text/xml" for PDFs and image files. Like the correct type for those data classes. _________________ Honesty is the best policy.
Insanity is the best defence.
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