Article ID: 199856
Article Last Modified on 7/15/2004
Private Sub Command1_Click()
Inet1.Execute "ftp://server", "size /"
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim vtData As Variant ' Data variable.
Select Case State
' ... Other cases are not shown.
Case icResponseCompleted ' 12
vtData = Inet1.GetChunk(1024)
End Select
Text1.Text = vtData
End Sub
An example of the code that is necessary to implement the workaround is available in the VBFTP.exe sample, which is available from the following Microsoft Knowledge Base article:
175179 SAMPLE: VBFTP.EXE: Implementing FTP Using WinInet API from VB
nFileSizeHigh
Specifies the high-order DWORD value of the file size, in bytes. This value is zero unless the file size is greater than MAXDWORD. The size of the file is equal to (nFileSizeHigh * MAXDWORD) + nFileSizeLow.
nFileSizeLow
Specifies the low-order DWORD value of the file size, in bytes.
#define MAXDWORD 0xffffffffThis can be defined in Visual Basic as follows:
Public Const MAXDWORD = &HffffffffIMPORTANT: WinInet uses a LIST command to gather information about the files on an FTP server. Some FTP servers do not return data in a format that WinInet can parse. In this case, the above work around will not work.
Additional query words: broken
Keywords: kbbug kbfix KB199856