Decode Base64 String


The client is sending Base64Encoded string to webMethods, which needs to be decoded to Base64 string what is the way to do so?

I am using pub.string.base64Decode and pub.string:byteToString to get the Base64 string. Seems its not decoding properly, any help please.

I wanted to replicate the functionality available in URL:

Whatever you are doing is right. It is pub.string.base64Decode followed by pub.string:byteToString. Is that encoded base64 being decoded properly on

Please provide the example or string you have taken for decoding/encoding. Procedure you are trying is 100% correct.
May be you can pass the encoding type while encoding and decoding the string.


another option to check is PSUtilities-Package, which also contains a base64decode service.

This package can be downloaed from the download section of the SAG community.

Advantage over build in service is that you can test it in IS Admin UI or Designer directly instead of creating a wrapper to map the string to the object input.


Thank you for your quick response. There was some issue in the encoding from client side, which they corrected.
Is there a way to find the image size from the Base64 string?
Please help.

Hi Sasanka,

might be a rough estimate:

The decoded size and the encoded size should have a factor of approx 1.2.

decoded size multiplied with 1.2 equals encoded size

Depends on data type (image, archive, pdf, …).


I have developed similar to this one using Javascript. Here is the link to test: