Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
Samples
|
Networking, Protocols, & Data FormatsInetAll Sample |
||||
Download sample | ||||
Description
INetAll sample is a client application that can download files using FTP, HTTP, or FILE protocols. It implements FTP and HTTP URL access using Wininet functions, and FILE URL access using Win32 CopyFile API
More DetailsThis sample uses InternetOpenUrl, InternetReadFile to do FTP and HTTP access. When accessing a FTP server with direct Internet access or a TIS proxy server, it also uses the INTERNET_FLAG_RAW_DATA flag in InternetOpenUrl and InternetFindNextFile to enumerate the directories and files on the FTP server. When a CERN proxy is used to do FTP, the proxy server uses FTP protocol to communication with the FTP server, and HTTP Protocol with the client. You can not use INTERNET_FLAG_RAW_DATA with a CERN proxy server. (Better viewed with fixed with font such as Courier.) Get ftp://host.com/root/test.doc HTTP 1.0 FTP Request |=========| |=============| |=============| | |---------------->| Cern-based |--------->| | | Client | HTTP | Proxy Server| FTP | Ftp Server | | |<----------------| |<---------| | |=========| |=============| |=============| HTTP/1.0 200 FTP Response To pass username and password to InternetOpenUrl, the sample internally constructs a URL in the following format: http://username:password@server:port/path To enumerate directories and files for a FILE URL, the sample uses WNetOpenEnum, WNetEnumResource, WNetClose to enumerates shares given a machine name; and FindFileFile, FindNextFile, FindClose to enumerate sub-directories and files of a complete UNC name.
Browser/Platform CompatibilityThis sample is supported in Win32 platforms.