Basic FTP will not work

Z80CPU

Member
Licensed User
Longtime User
Hello,

Thank you for any/all help you might provide! :)

I have attemepted to just DL a simple text file and it just will not work. I created a simple app that does just that and nothing else. In the 'real' app, UL AND DL do not work.

I have a public ftp server setup which has worked for years w/o issues and i can access it via my home pc (ftp is on same network as pc), and i can access it via an android app called 'FTP Cafe'. BOTH, internal IP/external IP work JUST FINE.

Bear in mind AGAIN, this server has been working for YEARS and is working NOW. my pc and android can UL/DL to it JUST FINE usin internal or an external IP address...it is NOT the server...
;)


...the " ' " statements were for testing, none of them worked...

the B4A app will just not work! I will log onto the server, but just will not download/upload ANYTHING. i have included the source for the app and the ftp server logs.

i am sure it is something stupid on my part, for the life of me, i cannot find it even after spending hours searching on forum.

i have also included screen shots from FireFTP (Firefox FTP add-on).

also attached, is the actual zipped-up file in case that is better for ya!


thanks VERY much!

ken
:)



app code:

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

Dim FTP As FTP

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")

If FirstTime Then
FTP.Initialize("FTP", "welcome2.centexusa.com", 3333, "prox", "?????")
End If

FTP.PassiveMode = True
'FTP.PassiveMode = False

FTP.DownloadFile("/This is a test file.txt" , True, File.DirRootExternal, "This is a test file.txt")
'FTP.DownloadFile("/This is a test file.txt" , False, File.DirRootExternal, "This is a test file.txt")

Msgbox("Done!","")

FTP.Close

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)
FTP.Close
End Sub


FTP Server Logs - Passive Mode:

(000026)4/28/2013 8:57:26 AM - (not logged in) (67.191.131.71)> Connected, sending welcome message...
(000026)4/28/2013 8:57:26 AM - (not logged in) (67.191.131.71)> 220-FileZilla Server version 0.9.41 beta
(000026)4/28/2013 8:57:26 AM - (not logged in) (67.191.131.71)> 220-
(000026)4/28/2013 8:57:26 AM - (not logged in) (67.191.131.71)> 220 Welcome To The CentexUSA's FTP Server!
(000026)4/28/2013 8:57:26 AM - (not logged in) (67.191.131.71)> USER prox
(000026)4/28/2013 8:57:26 AM - (not logged in) (67.191.131.71)> 331 Password required for prox
(000026)4/28/2013 8:57:26 AM - (not logged in) (67.191.131.71)> PASS ????
(000026)4/28/2013 8:57:26 AM - prox (67.191.131.71)> 230 Logged on
(000026)4/28/2013 8:57:26 AM - prox (67.191.131.71)> TYPE A
(000026)4/28/2013 8:57:26 AM - prox (67.191.131.71)> 200 Type set to A
(000026)4/28/2013 8:57:26 AM - prox (67.191.131.71)> PASV
(000026)4/28/2013 8:57:26 AM - prox (67.191.131.71)> 227 Entering Passive Mode (192,168,1,150,10,239)
(000026)4/28/2013 8:57:27 AM - prox (67.191.131.71)> disconnected.


FTP Server Logs - Active Mode:

(000028)4/28/2013 8:59:54 AM - (not logged in) (67.191.131.71)> Connected, sending welcome message...
(000028)4/28/2013 8:59:54 AM - (not logged in) (67.191.131.71)> 220-FileZilla Server version 0.9.41 beta
(000028)4/28/2013 8:59:54 AM - (not logged in) (67.191.131.71)> 220-
(000028)4/28/2013 8:59:54 AM - (not logged in) (67.191.131.71)> 220 Welcome To The CentexUSA's FTP Server!
(000028)4/28/2013 8:59:54 AM - (not logged in) (67.191.131.71)> USER prox
(000028)4/28/2013 8:59:54 AM - (not logged in) (67.191.131.71)> 331 Password required for prox
(000028)4/28/2013 8:59:54 AM - (not logged in) (67.191.131.71)> PASS ????
(000028)4/28/2013 8:59:54 AM - prox (67.191.131.71)> 230 Logged on
(000028)4/28/2013 8:59:54 AM - prox (67.191.131.71)> TYPE A
(000028)4/28/2013 8:59:54 AM - prox (67.191.131.71)> 200 Type set to A
(000028)4/28/2013 8:59:54 AM - prox (67.191.131.71)> PORT 192,168,1,21,219,160
(000028)4/28/2013 8:59:54 AM - prox (67.191.131.71)> 200 Port command successful
(000028)4/28/2013 8:59:54 AM - prox (67.191.131.71)> RETR /This is a test file.txt
(000028)4/28/2013 8:59:54 AM - prox (67.191.131.71)> 150 Opening data channel for file transfer.
(000028)4/28/2013 8:59:55 AM - prox (67.191.131.71)> 425 Can't open data connection.
 

Attachments

  • ftp-001a.JPG
    ftp-001a.JPG
    79.1 KB · Views: 318
  • ftp-002.JPG
    ftp-002.JPG
    39.6 KB · Views: 309
  • ftp-003.JPG
    ftp-003.JPG
    39 KB · Views: 326
  • FTP-Test.zip
    6 KB · Views: 295

Z80CPU

Member
Licensed User
Longtime User
FTP problem - Solved

Hello,

Thank you for your reply. Sadly, the example i used came from the tutorial.

And using a file w/o spaces should NOT be a problem, though I did try it...failure.

I was stupid on one thing, I did create a zero byte file on the android.

Even though i can use my PC to attach to my FTP server using my internal IP, the andriod will not. Once I changed the external address to an internal one, BINGO! It worked just fine.


Solution:

If you have an internal FTP server, and your're using an android on the SAME internal network, you MUST use the internal IP address of the FTP server and NOT the external address!

Thanks for all of your help!

:)
 
Upvote 0
Top