Article ID: 232194 - View products that this article applies to.
This article was previously published under Q232194
When you use the OpenUrl method of Microsoft Internet Transfer Control (ITC) to download files from Web servers, the resulting files may not be complete if the server uses "chunked" transfer-encoding to send the HTTP response data. The chunked method is used by Internet Information Server (IIS) to optimize the sending of dynamically generated content, such as that sent by Active Server Pages (ASP).
ITC allocates a buffer of 64K bytes and calls InternetReadFile in a loop. Whenever the buffer containing the read data is not full after the API returns, ITC will exit the loop. However, InternetReadFile can return when less than the total number of bytes requested were read into the buffer, which causes the problem. This is the case if the transfer-encoding is chunked.
A way to work around this problem is to call the WinInet APIs directly in Visual Basic, as described in the following two steps:
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the next service pack for Visual Studio 6.0.
For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:
194022To download the latest Visual Studio service pack, visit the following Microsoft Web site:
(http://support.microsoft.com/kb/194022/EN-US/ )INFO: Visual Studio 6.0 Service Packs, What, Where, Why
(http://support.microsoft.com/kb/194295/EN-US/ )HOWTO: Tell That a Visual Studio Service Pack Is Installed
For an example of how to call the WinInet APIs directly from Visual Basic, please see the following article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/175179/EN-US/ )FILE: VBFTP.EXE: Implementing FTP Using WinInet API from VB
Article ID: 232194 - Last Review: August 7, 2007 - Revision: 1.2