Click to return to the Web Content Management home page    
WpPost Function     WpPostFile Function     Web Publishing Programmer...    
Web Workshop  |  Web Content Management

WpPostEx Function


Posts files and directories to a desired site, using a user name and password.

Syntax

DWORD WpPostEx(
    HWND hWnd,
    DWORD dwNumLocalPaths,
    LPTSTR *pszLocalPaths,
    LPDWORD pdwSiteNameBufLen,
    LPTSTR szSiteName,
    LPDWORD pdwDestURLBufLen,
    LPTSTR szDestURL,
    LPSTR szUsername,
    LPSTR szPassword,
    DWORD dwFlags
);

Parameters

hWnd
Optional. Window handle to receive focus upon completion of this API call. This can be NULL.
dwNumLocalPaths
Number of elements in the array pointed to by pszLocalPaths.
pszLocalPaths
String names of files or directories to be posted. If the string specifies a directory (and the WPF_NO_RECURSIVE_POST flag is not set in the dwFlags parameter), all the files in that directory are posted.
pdwSiteNameBufLen
Size, in bytes, of buffer szSiteName. On return, contains the actual number of bytes used in szSiteName. If szSiteName is NULL or too small, this parameter shows the necessary size of the buffer to allocate.
szSiteName
Posting site name. This parameter and the szDestURL parameter may not both be NULL or empty if the WPF_NO_WIZARD flag is set. If this parameter is non-NULL and of sufficient size, and the WPF_NO_WIZARD flag is not set, on return it will contain the site to which the files were posted.
pdwDestURLBufLen
Size, in bytes, of buffer szDestURL. On return, contains the actual number of bytes used in szDestURL. If szDestURL is NULL or too small, this parameter shows the necessary size of the buffer to allocate.
szDestURL
Destination URL. If this parameter is non-NULL and of sufficient size, and the WPF_NO_WIZARD flag is not set, then on return it will contain the destination URL for the site.
szUsername
Optional. User name to use when logging onto the remote servers. If NULL or incorrect, the user is prompted to supply a user name and password.
szPassword
Optional. Password to use when logging onto the remote servers. If NULL or incorrect, the user is prompted to supply a user name and password.
dwFlags
Action flags. Possible values are shown in the following table.
WPF_FIRST_FILE_AS_DEFAULT
Take the first file specified in pszLocalPaths as the file that will be shown as the default page.
WPF_NO_RECURSIVE_POST
If any element in pszLocalPaths points to a directory, do not post files recursively.
WPF_NO_WIZARD
Do not prompt the user for any input.
WPF_NO_DIRECT_LOOKUP
Do not attempt to look up the site based on the site name. This has the same effect as a NULL or empty szSiteName.
WPF_NO_URL_LOOKUP
Do not attempt to look up the site based on the site URL. This has the same effect as a NULL or empty szSiteURL.
WPF_NO_PROGRESS_DLGS
Do not show the "Publishing files" progress bar during the transfer of files to the destination computer.
WPF_NO_UI
Predefined combination of WPF_NO_WIZARD and WPF_NO_PROGRESS_DLGS.
WPF_SHOWPAGE_WELCOME
Forces the wizard to display the initial Publish Your Files on the Web page. Normally this page is skipped if the only other page being displayed is the Finish page. Note that the WPF_NO_WIZARD flag overrides this one.
WPF_SHOWPAGE_SRCFILE
Forces the wizard to display the Select a File or Folder page. Normally this page is skipped if the path or paths to publish are specified in the call to WpPost. Note that the WPF_NO_WIZARD flag overrides this one.
WPF_SHOWPAGE_DESTSITE
Forces the wizard to display the Select a Web Server page. Normally this page is skipped if the site name is specified in the call to WpPost. Note that the WPF_NO_WIZARD flag overrides this one.
WPF_SHOWPAGE_PROVIDER
Forces the wizard to display any and all pages associated with the service provider. Note that it is the responsibility of service provider implementations to be compliant with this flag (see the specification for the AddWizardPages method.) Note that the WPF_NO_WIZARD flag overrides this one.
WPF_SHOWPAGE_ALL
Predefined combination of WPF_SHOWPAGE_*. Note that the WPF_NO_WIZARD flag overrides this one.

Return Value

NO_ERRORSuccessful.
WEBPOST_ERROR_INIT_FAILEDAn error occurred while attempting to initialize the Web Publishing API DLL.
WEBPOST_ERROR_PROV_QIThe Web Publishing API was unable to determine what interface is exported by the specified service provider.
WEBPOST_ERROR_POST_FILESAn error occurred while the Web Publishing API was attempting to post the requested files.
WEBPOST_ERROR_COCREATE_WIZARDThe Web Publishing API could not invoke the Web Publishing Wizard.
WEBPOST_ERROR_HTTP_GET_FAILEDInformational (nonfailure) result indicating failure in the attempt to retrieve one of the published files with an HTTP GET. This error is only returned in cases where the files were all successfully uploaded.
WEBPOST_ERROR_EXTENDED_ERRORA Web Publishing extended error occurred. This means that the API received an error code that the API client may not be able to translate, so the API performed the translation and cached the error message for retrieval on a call to the WpGetErrorString method.
WEBPOST_ERROR_NO_EXT_ERROR_INFOAn extended error occurred in the Web Publishing API, but the error message could not be retrieved.

Remarks

If the wizard is invoked (the WPF_NO_WIZARD flag is not set), the wizard will examine the information specified in the call to WpPost and display the minimum set of pages necessary to complete the publishing process (this minimum UI behavior may be overridden with the WPF_SHOWPAGE flags). If the user is prompted to enter the friendly name and/or URL for the site, this information is returned to the caller of WpPost in the buffers provided.

If the wizard is not invoked, WpPost calls WpBindToSite to get an interface pointer to the provider that owns the specified site. If the WpBindToSite call fails, WpPost tries to create the site by calling WpCreateSite. Note that WpPost passes the destination URL to WpBindToSite and WpCreateSite. When calling WpCreateSite, it also passes NULL for the local base directory, indicating that this site does not use the local base directory feature and that all posts to this site should go to the root destination URL; and it passes NULL for the service provider, specifying that the service provider should be determined by autobinding. If the site's provider cannot be determined from the site name passed to WpPost or an autobind, WpPost will fail.

Because WpPost relies on WpBindToSite to do site lookup, all site lookup functionality resides within WpBindToSite. The procedure followed when performing this lookup is detailed under WpBindToSite.

Function Information

Windows NTUse version 4.0 and later
WindowsUse Windows 95 and later
HeaderDeclared in Wpapi.h
Import LibraryLink with WebPost.lib
Minimum availabilityInternet Explorer 4.0


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.