Sign in to follow this  
Followers 0
darkjohn20

FTP Problems [Solved]

1 post in this topic

#1 ·  Posted (edited)

Alright, so I'm trying to connect to a FTP Server. My problem is that I need a way to differentiate between _FTP_Connect:

  • Not finding a Server
  • Having trouble logging in
As these things both return 0 by _FTP_Connect, I cannot determine which one is actually the problem. Any ideas?

Also, there is no problem with my other code, such as _FTP_Open, because on other servers I can connect just fine.

Sorry for the minimal amount of information. I don't know how else to explain what I need help with.

Edit: Solved this one myself. Guess this could server as help for anyone else with a similar problem.

Func _FTP_ServerExists()
    Local $sFTP_Error, $sFTP_Message

    _FTP_GetLastResponseInfo($sFTP_Error, $sFTP_Message)
    If StringReplace(StringReplace(StringReplace(StringReplace($sFTP_Message, @TAB, ""), @LF, ""), @CR, ""), " ", "") = "" Then
        ConsoleWrite("No Response!" & @CRLF)
        Return 0
    EndIf
    
    Return 1
EndFunc
Edited by darkjohn20

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0