Expand my Community achievements bar.

reading file to base64 string

Avatar

Former Community Member

Hi,

what is the right way to read some file from local filesystem to string variable as a base64 encoded data ?

I am doing this now by BeanShell :-/ (read file, convert it into base64 and put this to some variable).

Is it possible to do this somehow with standard Read Document service and "data coercing" - to coerce Document to binary and somehow to translate it to base64 ?

Thanks.

1 Reply

Avatar

Former Community Member

Sorry, I missed completely missed the xPath method:

getDocConententBase64(/process_data/@myDocument)

I very like executeScript component, but it is very bad idea to implement here algorithms for e.g. encoding.