Android Question Issue with FTP

Tyler

Member
Licensed User
Longtime User
Hey guys! I'm not quite sure why my code isn't working here, hopefully someone can help me out!

Here's my code:

B4X:
Sub ftp1_DownloadCompleted (ServerPath As String, Success As Boolean)
If Success = True Then
ftp1.Close

lblscroller.Text = File.ReadString(File.DirRootExternal & "/QGAdmin", "screen.txt")
Msgbox("success", "")
Else
Msgbox("FTP Failed", "")
End If
End Sub


Sub lblscroller_Click
    ftp1.Initialize("ftp1", hostname.Text, 22, username.Text, password.Text)
    ftp1.DownloadFile("/root/screen.txt", True, File.DirRootExternal & "/QGAdmin", "screen.txt")
    lblscroller.Text = File.ReadString(File.DirRootExternal & "/QGAdmin", "screen.txt")
End Sub


It's always returning success = false... I'm 100% sure the ftp details are correct as they're used elsewhere in the app and work properly.
 

sorex

Expert
Licensed User
Longtime User
check security on the file, maybe it has no read access for that ftp user.
 
Upvote 0

Tyler

Member
Licensed User
Longtime User
I seem to have got it working using jkssh2(Copy and pasted details so they were definitely correct). Still not sure what the issue was with FTP. At any rate, problem solved, on to the next one! Thanks for you help!
 
Upvote 0
Top