cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to store base64 string as binary?

uskalviskis
Participant
0 Likes
4,681

Hi all cloud developers,

currently I'm facing issue to which I can't find solution. I get through web service call binary content as base64 string. I want to store it as attachment in cloud. But currently seems like there is no possibility to do that.

First I thought that Binary.ParseFromString() function could solve this issue but now I understood that it's used differently.

Does anybody of you faced this issue and found solution?

Thanks,
Uldis

View Entire Topic
HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Uldis,

If Attachment is the name of the DO Attachment and you've already created an instance, would this code below do the job?

import ABSL;

import BASIS.Global;

  

var DataFromWebService : BinaryObject;

DataFromWebService.content = <...>      // from WebService

var BinaryObject = this.Attachement.Document.GetFirst().FileContent.BinaryObject;

BinaryObject.content = DataFromWebService.content;

  

HTH,

    Horst