Sign in to follow this  
Followers 0
mdwerne

Busted FTP since 3.3.2.0

1 post in this topic

#1 ·  Posted (edited)

I have been modifying all my scripts since 3.3.2.0 came out and have gotten most of the old (deprecated) code changed. I'm having problems with one script that is actually a blend of snipets from others examples. My problem is that while I can get the right file info from the FTP site, I never get the file transferred?

Also, the debug message box returns the following:

Bytes read: 0

File: vd2f3e74.jdb (this is the right file)

Size: 0

Complete?: True

Successful?: False

@error: 22

@extended: 12003

Can anyone see what I'm missing? Or what the @error and @extended messages mean?

Thanks for any suggestions,

-Mike

#include <GUIConstantsEx.au3>
#include <File.au3>
#include <FTPEx.au3>

$server = 'ftp.symantec.com'
$username = 'anonymous'
$pass = 'email@address.com'
$ftp_dir = '/public/english_us_canada/antivirus_definitions/symantec_antivirus_corp/jdb/'
$target_dir = @ScriptDir & "\Files\"

$ftp_file_mask = '*.jdb'
Download()

Func Download()

    $Open = _FTP_Open('MyFTP Control')
    If @error Then MsgBox(0, "ERROR", "Failed to open")

    $Conn = _FTP_Connect($Open, $server, $username, $pass, 1)
    If @error Then MsgBox(0, "ERROR", "Failed to connect")

    Dim $Handle

    $FileInfo = _FTP_FindFileFirst($Conn, $ftp_dir & $ftp_file_mask, $Handle)
    If $FileInfo[0] Then
        Do
            $dl_file = $FileInfo[10]
            $FileInfo = _FTP_FindFileNext($Handle)
        Until Not $FileInfo[0]
    EndIf

    $ftp_conn_string = "ftp://" & $server & $ftp_dir

    Local $hDownload = InetGet($ftp_conn_string, $target_dir & $dl_file, 1, 1)
    Do
        Sleep(250)
    Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
    Local $aData = InetGetInfo($hDownload) ; Get all information.
    InetClose($hDownload) ; Close the handle to release resourcs.
    MsgBox(0, "", "Bytes read: " & $aData[0] & @CRLF & _
            "File: " & $dl_file & @CRLF & _
            "Size: " & $aData[1] & @CRLF & _
            "Complete?: " & $aData[2] & @CRLF & _
            "Successful?: " & $aData[3] & @CRLF & _
            "@error: " & $aData[4] & @CRLF & _
            "@extended: " & $aData[5] & @CRLF)

    _FTP_FindFileClose($Handle)
    _FTP_Close($Open)

EndFunc   ;==>Download
Edited by mdwerne

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