How to read a file using SMB

Mike Henry

Member
Licensed User
Longtime User
I'm trying to use the SMB library to read and write files on a Windows computer.

The B4A SMB reference page shows an example of how to copy a file, but not how to read it to memory:
Basic4android - SMB

Erel's tutorial show how to read the directory listing, but not how to read a file:
http://www.b4x.com/forum/basic4andr...utorials/17179-android-smb-cifs-tutorial.html

I assume the DownloadFile2 will copy from a remote computer into the variable java.io_OutputStream, but how do I use the variable?
 

Mike Henry

Member
Licensed User
Longtime User
A stream would be good. I need to parse the file, and append another file.
But I don't see how I can access the OutputStream variable in the DownloadCompleted event.
Would I assign the OutputStream variable to a global variable in the DownloadFile2 function, then the same global variable becomes available in the DownloadComplete function?
 
Upvote 0
Top