Hello Devs,
I have a custom type with a field Doc() As Byte where I store documents.
Supported types are txt, docx, xlsx, and images.
What I'm trying to do is:
- Get the file stream from my istance
- Save the file on file system
- Open the file with default system program (notepad for txt files, office word for docx, office excel for xlsx).
How can I accomplish this?
Thanks in advance.
I have a custom type with a field Doc() As Byte where I store documents.
Supported types are txt, docx, xlsx, and images.
What I'm trying to do is:
- Get the file stream from my istance
- Save the file on file system
- Open the file with default system program (notepad for txt files, office word for docx, office excel for xlsx).
B4X:
Sub clvDocuments_ItemClick (Index As Int, Value As Object)
Dim item As Document = documentRepo.Read(Value)
If item.Doc <> Null And item.FileName.Length > 0 Then
FileUtils.BytesToFile(File.DirTemp, item.Description, item.Doc)
' how to open the file now?!?
End If
End Sub
How can I accomplish this?
Thanks in advance.