Creates a temporary site and binds to it.
Syntax
HRESULT CreateTempBinding( BSTR bsDestUrl, BSTR bsProvCLSID );
Parameters
- bsDestUrl
- Address of a null-terminated string that contains the destination URL for the site. This is where the files dropped on the File Upload Control will be posted. This may not be NULL or empty.
- bsProvCLSID
- Address of a null-terminated string that contains the CLSID of the provider that will handle this site. This may be NULL or empty, in which case the File Upload Control will attempt to find a posting information file or autobind to an appropriate provider.
Return Value
Returns S_OK if successful, or an error code otherwise.
Remarks
Garbage collection should take care of this site information when the user shuts down the browser.
Example
The Web page in the following example hosts the File Upload Control, which can be used to upload HTML content. Script on the page contains a call to the control's CreateTempBinding method, which creates a temporary site and binds to it.
<HTML> <HEAD> <TITLE>File Upload Control</TITLE> </HEAD> <BODY LEFTMARGIN=20 TOPMARGIN=20 BGCOLOR=#FFFFFF TEXT=#000000 LINK=#FF0066 VLINK=#330099 ALINK=#000000 language="VBS" onload="InitializeControl"> <FONT FACE="ARIAL" SIZE=2> <CENTER> <P><FONT SIZE=5><B>Welcome</B></FONT> </CENTER> <H3>File Upload</H3> <P> You can upload your HTML content using this control. <OBJECT classid="clsid:886E7BF0-C867-11CF-B1AE-00AA00A3F2C3" id=FlUpl1 width=100 height=100 align=textmiddle color=blue codebase=http://my_server/flupl/FlUpl.cab#Version=6,0,86,0> </OBJECT> You may drag and drop files onto it. Or double click on it to get a FileOpen dialog box. <SCRIPT LANGUAGE="VBS"> Sub InitializeControl FlUpl1.CreateTempBinding "http://my_server", "{8B14B770-748C-11D0-A309-00C04FD7CFC5}" End Sub </SCRIPT> <P ALIGN=CENTER><FONT SIZE=2><B>For more information on VB Script, visit the <A TARGET="_top" HREF="/vbscript/default.htm">VB Script site.</A></B> </FONT> </BODY> </HTML>