Jump to content

FTP Problems [Solved]


Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...