InterSystems FAQ rubric
In the sample below, an image file is encoded into a Base64 string in a class property, saved, decoded again with Base64, and restored to another file.
【Usage class】
Class User.test Extends %Persistent
{
Property pics As %GlobalBinaryStream;
}
【When importing】
set x=##class(User.test).%New() // create a new object
// prepare an image
set file=##class(%File).%New("c:\temp\Mii.png")
do file.Open("RUK\BIN\")
for {
if file.AtEnd=1 quit
// Convert image to Base64 format in chunks of 1024 bytes
set cnt=file..png)

.png)
.png)

