private Sub ImageToBlob(dir As String, f As String) As String
Dim InputStream1 As InputStream
InputStream1 = File.OpenInput(dir,f)
Dim su As StringUtils
Dim OutputStream1 As OutputStream
OutputStream1.InitializeToBytesArray(1000)
File.Copy2(InputStream1, OutputStream1)
Dim Buffer() As Byte 'declares an empty array
Buffer = OutputStream1.ToBytesArray
Return su.EncodeBase64(Buffer)
End Sub
'use it like this:
SQLInterno.ExecNonQuery2("INSERT INTO table (text, image) VALUES (?,?)",Array("test",ImageToBlob(File.DirApp,"name")))