#XPRIM_Binary Base64 encoding/decoding
Posted: Wed Nov 30, 2022 8:44 pm
Morning All
The code below takes a block of base64 data ( PDF document) and converts it to native PDF and stick it in to a CLOB.
My question is, will you get different decoding result when running this code on the server in a function ( iSeries ) as opposed to running in the client (Windows) in a reusable . ??? My assumption the PDF was encode to base64 on a windows server before being sent in the JSON
DEFINE_COM Class(#XPRIM_Binary) Name(#HashBytes)
* base64 block of data from Json
#MyBase64String := #Reader.ReadStringWithName( 'manifest' ).AsNativeString
* Decode Base64 string
#HashBytes.FromBase64String String(#MyBase64String) Errorinfo(#ErrorInfo)
#STD_CLOB := #HashBytes.AsFile
The code below takes a block of base64 data ( PDF document) and converts it to native PDF and stick it in to a CLOB.
My question is, will you get different decoding result when running this code on the server in a function ( iSeries ) as opposed to running in the client (Windows) in a reusable . ??? My assumption the PDF was encode to base64 on a windows server before being sent in the JSON
DEFINE_COM Class(#XPRIM_Binary) Name(#HashBytes)
* base64 block of data from Json
#MyBase64String := #Reader.ReadStringWithName( 'manifest' ).AsNativeString
* Decode Base64 string
#HashBytes.FromBase64String String(#MyBase64String) Errorinfo(#ErrorInfo)
#STD_CLOB := #HashBytes.AsFile