Android Question SMB Download-Append-Upload

Discussion in 'Android Questions' started by ElliotHC, Jul 30, 2019.

  1. ElliotHC

    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.

    Code:
    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
     
  2. ElliotHC

    ElliotHC Active Member Licensed User

    Forgot the last forward slash in the Filepath :rolleyes:
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice