Android Question FTP Upload problem


Licensed User
Longtime User
I am trying to FTP a single web page up to my web site. It has worked some months ago.I have tried the Net library and FTP Auto both with the same result.

I have tried two different web spaces of mine with the same result.

The error message I get, after a long time, is:
Error uploading file.
425 Could not open data connection to port 38071: Connection timed out
(The port number changes with each try)

I use a numerical IP address or URL and each yield the same result. The user and password I am using in the real code is correct as I can use other FTP software to administer and access my web sites.

The file is in the correct directory but with zero bytes. I have tried to upload different files all with the same result.

I have tried 2 android phones and one tablet, also both wi-fi and mobile data connection all with the same result.

Any help you could give me would be much appreciated.

Here is the code:

Sub Process_Globals
Dim L As String
Dim wifion As Boolean
Dim Writer As TextWriter
End Sub

Sub Globals
Dim FTP As FTP_Auto
Dim myLAN As ServerSocket
End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
FTP.Initialize(Activity, Me,"[IP or FTP URL]", "user","pass", 21,True, False)
End If
l = "Line1"
l = l & "Line2"
l = l & "Line3"
l = l & "Line4"
Writer.Initialize(File.OpenOutput( File.DirRootExternal , "test.html",False))
Writer.WriteLine(l )
If wifion=True Then
FTP.UpLoadFile( File.DirrootExternal ,"public_html", "test.html")
End If
End Sub

Sub CheckForWiFi()
If myLAN.GetMyIP <> "" Then
Log( myLAN.GetMyIP)
ToastMessageShow ("Internet connected OK", True)
End If
ToastMessageShow ("No Internet connection", True)
wifion = False
End Sub​