Jump to content

Impossible to start FTP session with FTP UDF...


Olish
 Share

Recommended Posts

Hi everybody,

I found FTP UDF in the "Example Scripts" forum and I tested it. Here is my code :

; INCLUSIONS

    #include "_ftp.au3"
    

; DEFINITION DES VARIABLES

    $sFTPServer =   "****"
    $sFTPUser =     "****"
    $sFTPPassword = "****"
    $iFTPPort =     21

    $sFTPFolder =   "/virtualsurveyor"


; CONNEXION AU SERVEUR FTP

    $iFTPIdentifier = _FTPOpen("myftp")
    
    If @error = -1 Then
        MsgBox(16, "Virtual Surveyor", "Virtual Surveyor n'a pas pu démarrer la surveillance car il lui est impossible de se connecter au serveur " & $sFTPServer)
        Exit
    EndIf

But this does not work. The _FTPOpen() function sets @error to -1.

What can I do please ? I don't understand why this doesn't work.... :P

Olivier, form France.

Olivier, from France.Free Wake On LAN script

Link to comment
Share on other sites

But this does not work. The _FTPOpen() function sets @error to -1.

What can I do please ? I don't understand why this doesn't work.... :P

run this right after _FTPOpen() and then look up the error code on MSDN.

$lastError = DllCall("kernel32.dll", "int", "GetLastError")
MsgBox(0,"",$lastError[0])

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

$iFTPIdentifier = _FTPOpen("myftp")
    
    $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    MsgBox(0,"",$lastError[0])

This code returns error number 0... :">

MSDN means that the operation completed successfully... :P

What's the matter ???

I guess, there is something else wrong on your system.

Disable all desktop firewall and/or spyware catcher tools. They might interfere with the Win32 API and possibly block the call to InternetOpen (used by _FTPOpen). Also post the AU3 version.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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...