## WebPost Overview

The components of the WebPost Software Development Kit (SDK) allow authoring tools to easily post Web pages (files) to the user's Internet Web site. The WebPost functions can be used to connect to the Internet Service Provider (ISP), determine the protocol needed to copy the files, and so on. Optionally, these functions can also display a wizard to guide the user through posting a file.

### WebPost API

The WebPost application programming interface (API) makes it possible for authoring tools to post Web pages to an Internet site with just one call to the WpPost function. In a typical scenario, an authoring tool's File menu would include a Post to Web button that, when clicked, causes the tool to call the WpPost function. This function starts a wizard that asks the user for a friendly name for the Internet site, the Uniform Resource Locator (URL) for the given site, and the name of a dial-up connection for accessing the Internet. Next, the function connects to the Internet server at the given URL, determines the protocol to use for posting the Web pages, and then posts the requested files. For subsequent posting to the same site, this function remembers the details of how to connect to the site, and posts the files with little user intervention. Thus, the WebPost API maintains an association between a friendly site name, remembers all the details involved in posting to that site, and allows the applications to easily post Web pages to a site or to the URL associated with that site.

As an alternative to the wizard, an authoring tool can let the user choose the Web site before calling WpPost by displaying a list of sites (plus a New Site item) obtained by a call to the WpListSites function. The list of sites could be in a nested menu that appears when the user clicks the Post to Web button.

### WebPost Service Providers

The WebPost dynamic-link library (DLL) can post Web pages to some of the popular types of Internet servers, including the National Center for Supercomputing Applications' (NCSA's) httpd and Microsoft's Internet Information Server (IIS). To post to other types of Internet servers, the WebPost API uses the WebPost Service Provider Interface (SPI) to communicate with DLLs that "know how" to post Web pages to those servers.

A WebPost service provider is implemented as an OLE Component Object Model (COM) server. An authoring tool can take advantage of the functionality available from a WebPost service provider by calling functions implemented by the provider. An authoring tool uses the WpBindToSite function to retrieve the addresses of the provider's functions. For descriptions of the functions that a provider implements, see WebPost SPI Interface Functions.

#### Posting Information File

Because of variations among Internet servers, Microsoft requests that Internet Service Providers (ISPs) include a posting information file named postinfo.html on the root URLs of their Internet servers. (Because file names are case-sensitive on some servers, the name of the postinfo.html file should be in all lowercase letters.) This file contains details about the posting protocol and policy. The standard WebPost service provider uses the information in the file to help with the detection of the WebPost protocol.

The following is a sample postinfo.html file that the default provider uses. The comments section that follows the <body> tag contains configuration information for authoring tools that use the Microsoft WebPost functions.

    <html>
    <!-- postinfo.html version 0.100 -->

    <head>
    <title>
        Web Posting Information
    </title>
    <head>

    <body>
    <!--
        WebPost
        version="0.100"
        BaseURL="http://<servername>/~$USERNAME"
        BasePath="public_html"
        FtpServerName="<servername>"
        XferType="FTP"
        DefaultPage="default.htm"
        VerifyFiles="1"
        CreateRoot="1"
    -->

    <h1>
        Web Posting Information
    </h1>

#### Provider DLL Installation

Each provider should create a subkey in the following registry location:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
        \WebPost\Providers

The subkey consists of the WpSite class identifier (CLSID) that the provider exports. Within this subkey, you should enter the following values:

Value | Meaning
Description | A string that contains the name of the provider. This name is used in the wizard; it appears in the list box that contains the names of the providers.
Path | The path of the WebPost service provider DLL.
Priority | A doubleword value that indicates the provider's priority. A value of 0 is high priority. The default provider has a priority of 8192.

The following example shows the registry entries for the default provider:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Providers
        \{3151E2E0-6C4C-11CF-86B1-00AA0060F86C}
            "Provider"="Other Internet Provider"
            "Path"="defwpp.dll"
            "Priority"=hex:00,10,00,00

All providers should also register their class identifiers at the following registry location, with the value name set to the class identifier. WebPost functions use the entries in this registry location to determine which providers to load.

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\WebPost\Providers

The default provider entry at this location is as follows:

    "{3151E2E0-6C4C-11CF-86B1-00AA0060F86C}"=""

© 1996 Microsoft Corporation