Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function ReadBinData(ByVal strFileName As String) As Variant
Dim lLen As Long
Dim iFile As Integer
Dim arrBytes() As Byte
Dim lCount As Long
Dim strOut As String
'Read from disk
iFile = FreeFile()
Open strFileName For Binary Access Read As iFile
lLen = FileLen(strFileName)
ReDim arrBytes(lLen - 1)
Get iFile, , arrBytes
Close iFile
ReadBinData = arrBytes
End Function
'encode
Set oElement = oDom.createElement("TEST")
oRoot.appendChild oElement
oElement.dataType = "bin.base64"
oElement.nodeTypedValue = ReadBinData(filepath)
'decode
m_Doc.Load xmlfilepath
Set oNode = m_Doc.selectSingleNode("TEST")
byteArray = oNode.nodeTypedValue
Open outputfile For Binary As #1
Put #1, 1, byteArray
Close #1