I'm trying to construct code that will use file chooser to open an image file (jpg) in preparation to save it to Mysql database as blob file. The code I'm experimenting is a copy and paste from different thread.
1. I don't really understand, how result.rows be used here?
2. How can I replace File.OpenInput("C:\AB4JProjects","caption.png") after I select using File chooser?
I appreciate any input and thanks for time.
B4X:
Sub btnfd_MouseClicked (EventData As MouseEvent)
Dim f As String = fc.ShowOpen(MainForm)
If f <> "" Then
TextArea1.Text = File.ReadString(f, "")
End If
For Each row() As Object In result.Rows
Dim out As OutputStream = File.OpenInput("C:\AB4JProjects","caption.jpg")
Dim In As InputStream
Dim Buffer() As Byte
Buffer = row(0) ' gives error here, says that can not convert a string to byte array
In.InitializeFromBytesArray(Buffer, 0, Buffer.Length)
File.Copy2(In, out)
out.Close
End Sub
1. I don't really understand, how result.rows be used here?
2. How can I replace File.OpenInput("C:\AB4JProjects","caption.png") after I select using File chooser?
I appreciate any input and thanks for time.