David,
I am looking for information on decoding a base64 string.  We will be
receiving this back with an xml stream from a client.  The base64
string is a image which we must decode and write out.

what version of U2 are you on? What O/S?

UV 10.0 and later allows you to call

ALG = "Base64"
ACTION = 2 ;* 1 = Encode, 2 = Decode
INLOC = 1 ;* 1 = Data in string, 2 = Data in file (B64DATA should hold path to file)
OUTLOC = 1 ;* 1 = Data in string, 2 = Data in file (RESULT should hold path to file)


RETURNCODE = DECODE(ALG, ACTION, B64DATA, INLOC, RESULT, OUTLOC)
IF RETURNCODE NE 0 THEN
        PRINT "DECODING FAILED ":RETURNCODE
        * 1 - Unsupported Algorithm
        * 2 - Invalid Parameters
        * 3 - Data cannot be read
        * 4 - data cannot be encoded/decoded
END

-----------------

You could also find a uudecode utility for your O/S. Write the data to a type 19 (DIR) file and execute the command to decode it.

-----------------

Lastly you could read RFC3548 and roll your own converter.
As a hint, BYTEVAL(STR, POS) is much faster than SEQ(STR[POS,1]) under UV.


HTH,



Craig
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to