Contents Index Topic Contents | ||
Previous Topic: WpPost Next Topic: WpPostFile |
WpPostEx
DWORD WpPostEx( [in] HWND hWnd [in] DWORD dwNumLocalPaths [in] LPTSTR * pszLocalPaths [in, out] LPDWORD pdwSiteNameBufLen [in, out] LPTSTR szSiteName [in, out] LPDWORD pdwDestURLBufLen [in, out] LPTSTR szDestURL [in] LPSTR szUsername [in] LPSTR szPassword [in] DWORD dwFlags );Posts files and directories to a desired site, using a user name and password.
- Returns NO_ERROR if successful. Otherwise, returns an error code, which may be one of the following:
WEBPOST_ERROR_INIT_FAILED WEBPOST_ERROR_PROV_QI WEBPOST_ERROR_POST_FILES WEBPOST_ERROR_INIT_FILES WEBPOST_ERROR_COCREATE_WIZARD WEBPOST_ERROR_HTTP_GET_FAILED WEBPOST_ERROR_EXTENDED_ERROR WEBPOST_ERROR_NO_EXT_ERROR_INFO For further information on error codes, see Appendix B, Error Codes.
- hWnd
- Optional. Window handle to receive focus upon completion of this API call. May 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
- The 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, then 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
- The 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. The user name to use when logging on to the remote servers. If NULL or incorrect, the user is prompted to supply a user name and password.
QUESTION: Does WP prompt for both a user name and password if either the user name is NULL or incorrect or the password is NULL or incorrect (versus just prompting for only the missing information)? For example, if the user name is correct but the password is not correct, does WP prompt for only a password?
- szPassword
- Optional. The password to use when logging on to 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.
Value Meaning 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 of the AddWizardPages SPI function.) 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. 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 WpBindToSiteand 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 auto-binding. If the site's provider cannot be determined from the site name passed to WpPost or an auto-bind, WpPost will fail.
Since 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.
Examples
C/C=++{ HRESULT hResult = NOERROR; LPTSTR szLocalPaths = {"c:\\MyDir"}; hResult = WpPost( NULL, 1, &szLocalPaths, 0, NULL, 0, NULL, "anonynous", "e-mail", 0); }
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.