Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2004 Nov : FTP Error 3??

www.cryer.info
Managed Newsgroup Archive

FTP Error 3??

Subject:FTP Error 3??
Posted by:"chon" (ch..@discussions.microsoft.com)
Date:Thu, 18 Nov 2004 07:12:03

I have a DLL written in VB6 that uses WinInet's FTPGetFile method.  On one
particular server running Windows Server 2003 we're getting an error 3
returned.  I cannot find a reference to an error 3 anywhere regarding FTP.
Does anybody have a clue as to what the system is trying to tell me?  Here's
the relevant code:

    'initialize the ftp server.
    hInternet = InternetOpen("VBnet FTP Transfer", _
                        INTERNET_OPEN_TYPE_DIRECT, _
                        vbNullString, _
                        vbNullString, _
                        GENERIC_WRITE)

    If hInternet = 0 Then
        lngErrorCode = HandleFTPError()
    Else

        hConnect = InternetConnect(hInternet, _
                                strHost, _
                                INTERNET_DEFAULT_FTP_PORT, _
                                strUserID, _
                                strPassword, _
                                INTERNET_SERVICE_FTP, _
                                INTERNET_FLAG_EXISTING_CONNECT Or _
                                INTERNET_FLAG_PASSIVE, _
                                1&)

        If hConnect = 0 Then
            lngErrorCode = HandleFTPError()
        Else
            ' check ToName parameter
            If Len(strToName) > 0 Then
                ' a file name was passed in
                mstrFileName = strToName
            Else
                ' parameter was empty, last array node must be the file name
                mstrFileName = arrFileInfo(UBound(arrFileInfo))
            End If

            ' build file path to actual file name
            strFTPPath = strHostDir & "/" & arrFileInfo(UBound(arrFileInfo))

            'Get the file from the FTP server
            lResult = FtpGetFile(hConnect, strFTPPath, strToDir & "\" &
mstrFileName, False, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY Or
INTERNET_FLAG_RELOAD, 0&)

            If lResult = 0 Then
                lngErrorCode = HandleFTPError()
            End If

            'we have to close the handle as soon as we're done with it
            'or else, all other Inet calls will be blocked.
            ' assume success
            InternetCloseHandle hConnect
        End If

        ' close the Internet connection handle
        InternetCloseHandle hInternet

Replies:

www.cryer.info
Managed Newsgroup Archive