Android Question SMB Download-Append-Upload

ElliotHC

Active Member
Licensed User
I've been having some trouble trying to download, append and upload a file in a shared folder on a windows 7 laptop over a wifi network.

I'm using this code.

B4X:
Private rp As RuntimePermissions
    Private FilePath As String
    FilePath = rp.GetSafeDirDefaultExternal("")

    SMB1.SetCredentials(Username,Password,"")
    SMB1.Initialize("SMB1")
    SMB1.Downloadfile("smb://Engineering-pc/Test", DateTime.Date(DateTime.Now) & ".txt",FilePath,DateTime.Date(DateTime.Now)  & ".txt")

    Dim Writer As TextWriter
    Writer.Initialize(File.OpenOutput(FilePath, DateTime.Date(DateTime.Now) & ".txt", True))
    Writer.Writeline(",Here is some appended text.")' or writeline for CR
    Writer.Flush
    Writer.Close
    
    SMB1.UploadFile(FilePath, DateTime.Date(DateTime.Now)  & ".txt","smb://Engineering-pc/Test", DateTime.Date(DateTime.Now) & ".txt")

But nothing seems to happen.

Also, I can't see where even this file is supposed to end up on the device to be able to check if it's even downloaded it.

Does anyone have a working example of this? I would have assumed that without any error message in the log it worked.. Although my file is unchanged
 
Top