+ Start a Discussion
hermitagehermitage 

Base 64 help

Hi Everyone,

 

Can one help me in using base64 encoding directly in our code. If possible can you please give a sample code.

 

Thanks,

sujith

Best Answer chosen by Admin (Salesforce Developers) 
gtindugtindu

 

Blob testBlob = Blob.valueOf('testing');
String base64output = EncodingUtil.base64Encode(testBlob);
Blob output = EncodingUtil.base64Decode(base64output);

 

 

All Answers

gtindugtindu

 

Blob testBlob = Blob.valueOf('testing');
String base64output = EncodingUtil.base64Encode(testBlob);
Blob output = EncodingUtil.base64Decode(base64output);

 

 

This was selected as the best answer
hermitagehermitage

Thanks for your help. I will try that way. Actually i am trying to encode a certification file. how can i do that.