Microsoft KB Archive/195653

= SAMPLE: Using FTP WinInet APIs in Visual Basic with SimpleFtp =

Article ID: 195653

Article Last Modified on 8/19/2005

-

APPLIES TO


 * Microsoft Internet Client Software Development Kit 4.0
 * Microsoft Internet Client Software Development Kit 4.01
 * Microsoft ActiveX SDK
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q195653



SUMMARY
This sample file demonstrates how to use WinInet FTP APIs in a Visual Basic (VB) application.



MORE INFORMATION
The sample demonstrates the following concepts:
 * How to enumerate a directory on the FTP server and return file information such as creation date and size.
 * How to upload large files to the FTP server without blocking the entire application and with reporting transfer progress. There are two ways of uploading a file:
 * By using the FtpPutFile API. However, this API blocks until the entire file has been uploaded. Upon clicking the Put button, the sample will use this method.
 * By using FtpOpenFile and InternetWriteFile. Once the file is open it can be uploaded in chunks. This enables the application to report upload status and avoid blocking. It does this by calling DoEvents between calling InternetWriteFile. Upon clicking the Put Large File button, the sample will use this method.
 * How to get text information for WinInet errors and how to retrieve extended error information. For simplicity, the sample does not implement downloading of the large files. This functionality is similar to method b) above; however, you should use the InternetReadFile API instead of InternetWriteFile.