Hi there. Total Noob question coming up - please don't laugh.
I am trying to retrieve text from an FTP site.
If I enter
ftp://tgftp.nws.noaa.gov/data/forecasts/taf/stations/EGPH.TXT
into my browser I get a file back with the text for EGPH -that's the ICAO code for an airfield, and that FTP call returns the weather for that airfield, EGPH being Edinburgh in the UK.
If I send
ftp://tgftp.nws.noaa.gov/data/forecasts/taf/stations/EGPD.TXT
I get the weather for EGPD - Aberdeen in the UK.
I am sure you get the general idea!
My question is how do I replicate this in B4A? The login for the NOAA.GOV site is via anonymous FTP through port 21, so I have been trying to connect and get the weather text using the following code:
the_ftp="ftp://tgftp.nws.noaa.gov"
myFTP.ABFTPConnect(the_ftp,21,"anonymous","")
If myFTP.ABFTPConnected = True Then
Msgbox("Connected", "")
Else
Msgbox(myFTP.ABFTPLastError, "")
Return
End If
This does not work. I just get an "Error connecting" message back.
And as a result, the following code to retrieve the weather and store it locally never gets to run - although I suspect this code is wrong too.
myftp.ABFTPDownload("/data/observations/metar/stations/","EGPD.TXT", sdRoot, "egpf.txt")
Where am I going wrong?
Thanks for any help.
Jonathan
I am trying to retrieve text from an FTP site.
If I enter
ftp://tgftp.nws.noaa.gov/data/forecasts/taf/stations/EGPH.TXT
into my browser I get a file back with the text for EGPH -that's the ICAO code for an airfield, and that FTP call returns the weather for that airfield, EGPH being Edinburgh in the UK.
If I send
ftp://tgftp.nws.noaa.gov/data/forecasts/taf/stations/EGPD.TXT
I get the weather for EGPD - Aberdeen in the UK.
I am sure you get the general idea!
My question is how do I replicate this in B4A? The login for the NOAA.GOV site is via anonymous FTP through port 21, so I have been trying to connect and get the weather text using the following code:
the_ftp="ftp://tgftp.nws.noaa.gov"
myFTP.ABFTPConnect(the_ftp,21,"anonymous","")
If myFTP.ABFTPConnected = True Then
Msgbox("Connected", "")
Else
Msgbox(myFTP.ABFTPLastError, "")
Return
End If
This does not work. I just get an "Error connecting" message back.
And as a result, the following code to retrieve the weather and store it locally never gets to run - although I suspect this code is wrong too.
myftp.ABFTPDownload("/data/observations/metar/stations/","EGPD.TXT", sdRoot, "egpf.txt")
Where am I going wrong?
Thanks for any help.
Jonathan