I have this code which i have used earlier also but for some reason in this project it is not working.
B4X:
ft.Initialize("ft","ftp.xyz.com",21,"MyFTP","MyPwd")
ft.PassiveMode=True
ft.List(Starter.gsCmpyCode&"/MyFolder/")
Wait For ft_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
if success then
.......
I put break point on Wait... it never goes to next line (if success... )
Your code sample looks fine to me. The only question I have is "What is the value of Starter.gsCmpyCode?". Does it end with "/"? If so your folder path value might be causing the problem.
I have this code which i have used earlier also but for some reason in this project it is not working.
B4X:
ft.Initialize("ft","ftp.xyz.com",21,"MyFTP","MyPwd")
ft.PassiveMode=True
ft.List(Starter.gsCmpyCode&"/MyFolder/")
Wait For ft_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry)
if success then
.......
I put break point on Wait... it never goes to next line (if success... )
Thanks Teddybear,
Its a shared server ftp works. There is no else statement in ListCompleted and I have no idea about cmdline.
ft.UploadFile works in same project.
B4X:
Dim sf1 As Object = ft.UploadFile(File.DirInternal&"/Myfolder/","Profile.jpg",False,sImageFilePath)
Wait For (sf1) ft_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
ToastMessageShow("Image Added Successfully.",True)
Else
Log("Error uploading file")
End If
Thanks Teddybear,
Its a shared server ftp works. There is no else statement in ListCompleted and I have no idea about cmdline.
ft.UploadFile works in same project.
B4X:
Dim sf1 As Object = ft.UploadFile(File.DirInternal&"/Myfolder/","Profile.jpg",False,sImageFilePath)
Wait For (sf1) ft_UploadCompleted (ServerPath As String, Success As Boolean)
If Success Then
ToastMessageShow("Image Added Successfully.",True)
Else
Log("Error uploading file")
End If
1. Add an else statement in ListCompleted, see if it is timeout or failure.
2. On the windows or linux cmd line, connect to ftpserver using ftp, run ls or dir command see if it is timeout or failure either
If it is timeout or failure,I suppose maybe the server doesn't support LIST command